Need Help..! How can I get my database on my andriod phone.?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Need Help..! How can I get my database on my andriod phone.?

Post by snop21 » Mon Jan 20, 2014 4:07 pm

I have a problem of getting back my database on my andriod phone. All were running great But that's the only problem I have.

Here's my connection string where I save my database on my andriod app

----->>>>   put specialFolderPath("documents") & "/MyCmbs.db" into tDatabasePath

I can't access the root on my andriod because it's not rooted.

Is there anyway to get it back and save it into my computer?.

your help very much appreciated.

Thank you.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Need Help..! How can I get my database on my andriod pho

Post by Mark » Mon Jan 20, 2014 6:18 pm

Hi,

Can you connect your phone to your computer and browse the file from there? From my computer, I can access all files and directories of my Android tablet.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Need Help..! How can I get my database on my andriod pho

Post by snop21 » Wed Jan 22, 2014 1:40 pm

Hi Mark,

In mine I can't access the root file of my andriod some forum says we can just access it if our Andriod device is rooted. I am using Acer iconia B1.

Regards

-snop21

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Need Help..! How can I get my database on my andriod pho

Post by jacque » Wed Jan 22, 2014 7:42 pm

I can't think of any way to do this easily on an unrooted device. The data folders aren't accessible without root access.

One thing that might work is to use a Dropbox library and script your app to save a copy of the database to a Dropbox folder. There is one Android-compatible library available, but it requires some Dropbox setup to get an app ID and some other things I've never done, so I'm not sure how much work that is. There is a link to the libary in this forum somewhere, try a search for "phxDropboxLib".

If you are just looking for a way to back up the file, Helium can do it. It's available in the Play Store in both free and paid versions. The files it saves aren't in a useable form though, and only work when restoring with Helium.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Need Help..! How can I get my database on my andriod pho

Post by Mark » Wed Jan 22, 2014 9:04 pm

Hi snop21,

If I understand you correctly, you're not trying to recover your own data but you're trying to find a way to store user data and reload these data after the user deletes and re-installs your app.

I suppose you don't want people to require a Dropbox account. That wouldn't give your users a professional impression of you, but you might offer them Dropbox as an option. Helium would be even worse.

If you want to be able to access a database as read-only, you can include the database in your standalone. The Standalone Application Settings window has a Files panel, where you can include your database. You can access this database with

Code: Select all

specialFolderpath("engine") & "/databasename.db"
If you want to create a new database with read and write access, you can do this in

Code: Select all

specialFolderpath("documents") & "/databasename.db"
You need no rooted device for this.

You can include an option for the user to keep a backup of the user data on your own web server. Just upload a dump of the data to your server, using LiveCode's post to URL command. (Unfortunately, libUrlMultipartFormData won't work on mobile devices). However, you can write a slightly smart PHP-script to receive chunks of data. I think you asked me elsewhere about PHP and I'll try to answer that question there.

Another solution would be FTP. After dumping your database into a variable, you can upload it with one command:

Code: Select all

put myData into url "ftp://user:password@ftp.myserver.xyz/dir/userdatabase.gz"
Of course, this isn't really safe, because your username and password would be somewhere in the programme.
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Need Help..! How can I get my database on my andriod pho

Post by jacque » Wed Jan 22, 2014 9:16 pm

Just to be clear Mark, the Dropbox and Helium methods were intended to retrieve the file from an Android device for developer use, not to store and work with the data within the app itself. Your original response assumed the same thing, I think.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Need Help..! How can I get my database on my andriod pho

Post by Mark » Wed Jan 22, 2014 11:02 pm

Jacque,

I *believe* that OP doesn't want a one-off solution or a custom solution for his/her own use, but instead something that allows him/her to keep a backup of the data if the app is removed by the user or if a similar situation occurs. I'm not entirely sure, though.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

snop21
Posts: 90
Joined: Mon Jan 20, 2014 2:54 pm

Re: Need Help..! How can I get my database on my andriod pho

Post by snop21 » Thu Jan 23, 2014 6:40 am

hi Guys!

Thank you for giving me hint how to do it. you both had great Ideas..! :))

I'll try that all.. :))

Kudos Livecoders.. ! :))

Regards

-snop21

Post Reply