Page 1 of 1
How to build a data transfer app for Android?
Posted: Thu Apr 14, 2016 3:52 am
by teerana73
People tends to change their phone frequently in nowadays so it's a must-to-do task to transfer data(contacts/sms/music/ebooks...) from one device to other. I am planning to do such an app that supports a wide range of Android smartphone and tablets. Where should I get started? I just learn Android development a couple of months ago. Would someone share some experience on this or open source library on data transfer?
Re: How to build a data transfer app for Android?
Posted: Thu Apr 14, 2016 2:38 pm
by MaxV
Read this:
http://livecode.wikia.com/wiki/Saving_files_on_Android
And for contacts read
mobileGetContactData on livecode dictionary
Re: How to build a data transfer app for Android?
Posted: Thu Apr 14, 2016 9:05 pm
by jacque
I don't think this is possible most of the time. Android apps are sandboxed, which means they can only write to their own protected folders. Apps in general do not have access to other areas of the device except for minimal interaction like allowing a user to select a contact or a photo. You can't read or write to the folders of other apps without a rooted device, which most users do not have (and there are security issues if they do.) That's why most of the backup apps on the Play Store specify they only work with rooted phones.
Google, however, does store user data in its cloud if the user has allowed it, and when a new device is registered with valid Google credentials, most of the data can be transfered to the new device via their services. If you turn on Google's backup cloud services, moving to a new device is fairly easy.
http://lifehacker.com/5843206/how-to-up ... g-with-you
Re: How to build a data transfer app for Android?
Posted: Fri Apr 15, 2016 2:30 am
by teerana73
MaxV wrote:And for contacts read mobileGetContactData on livecode dictionary
cool, thanks for the tip
Re: How to build a data transfer app for Android?
Posted: Fri Apr 15, 2016 2:32 am
by teerana73
jacque wrote:I don't think this is possible most of the time. Android apps are sandboxed, which means they can only write to their own protected folders. Apps in general do not have access to other areas of the device except for minimal interaction like allowing a user to select a contact or a photo. You can't read or write to the folders of other apps without a rooted device, which most users do not have (and there are security issues if they do.) That's why most of the backup apps on the Play Store specify they only work with rooted phones.
Google, however, does store user data in its cloud if the user has allowed it, and when a new device is registered with valid Google credentials, most of the data can be transfered to the new device via their services. If you turn on Google's backup cloud services, moving to a new device is fairly easy.
thanks for the explanation. I thought iOS app are sandboxed. I searched online and found there are several desktop apps which can do that. test passed.
Re: How to build a data transfer app for Android?
Posted: Fri Apr 15, 2016 9:34 am
by MaxV
jacque wrote:I don't think this is possible most of the time. Android apps are sandboxed, which means they can only write to their own protected folders. Apps in general do not have access to other areas of the device except for minimal interaction like allowing a user to select a contact or a photo. You can't read or write to the folders of other apps without a rooted device, which most users do not have (and there are security issues if they do.) That's why most of the backup apps on the Play Store specify they only work with rooted phones.
http://lifehacker.com/5843206/how-to-up ... g-with-you
No Jacque, Adroid is different from iOS. Apps can write in some common phone folders like the sdcard. It works for normal phones, not rooted.
Read here:
http://livecode.wikia.com/wiki/Saving_files_on_Android
Re: How to build a data transfer app for Android?
Posted: Fri Apr 15, 2016 4:23 pm
by jacque
The OP wanted to transfer app data to a new phone, which would require reading and writing to the private data stores for many apps. Is that possible on an unrooted device?
Edit: Just to clarify, the filesystem document in the link mentioned says this:
However Android, in order to preserve mobile phone security, doesn't unpack your app in filesytem, but in a separate virtual folder that seems in the filesystem.
For example if you app identifier is "com.yourcompany.myapp", then app will be unpacked in /data/app/com.yourcompany.myapp-1.apk/; that it's a fake directory that doesn't exist (for security reasons).
This is the equivalent of sandboxing on Android. On an unrooted device, the virtual directories are not readable or writeable by apps that do not own those directories. Directories in the common areas of the SD card can be accessed in a limited way.
There is a difference between a desktop app that copies files and an app, like a backup app, running on Android. When a device is mounted to the desktop, it functions as a hard drive and the public areas can be read and copied. However, the private virtual app folders do not appear on the desktop and cannot be accessed, the same way it works on the device.
If the original intent was to copy only the public folders, then it is possible to do that with a desktop app. I don't know if it is possible to read the public file system from within Android; it might be, I haven't tried it.
Re: How to build a data transfer app for Android?
Posted: Mon Apr 18, 2016 1:18 pm
by MaxV
jacque wrote:The OP wanted to transfer app data to a new phone, which would require reading and writing to the private data stores for many apps. Is that possible on an unrooted device?
Edit: Just to clarify, the filesystem document in the link mentioned says this:
However Android, in order to preserve mobile phone security, doesn't unpack your app in filesytem, but in a separate virtual folder that seems in the filesystem.
For example if you app identifier is "com.yourcompany.myapp", then app will be unpacked in /data/app/com.yourcompany.myapp-1.apk/; that it's a fake directory that doesn't exist (for security reasons).
This is the equivalent of sandboxing on Android. On an unrooted device, the virtual directories are not readable or writeable by apps that do not own those directories. Directories in the common areas of the SD card can be accessed in a limited way.
There is a difference between a desktop app that copies files and an app, like a backup app, running on Android. When a device is mounted to the desktop, it functions as a hard drive and the public areas can be read and copied. However, the private virtual app folders do not appear on the desktop and cannot be accessed, the same way it works on the device.
If the original intent was to copy only the public folders, then it is possible to do that with a desktop app. I don't know if it is possible to read the public file system from within Android; it might be, I haven't tried it.
On Android you car read quite all filesystem, you can access also to the contacts. You can't just copy other apps and their private folders/files.
For example, to backup purpose you can copy all the data needed (contact, pictures, music, etc.) and put them in /mnt/sdcard/MyBackup/myBackup2016.zip.
When connecting to a windows PC you can copy D:/MyBackup/myBackup2016.zip where you like.