Creating Apps for use on Android mobile phones

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

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Dragondos2020
Posts: 29
Joined: Mon Apr 20, 2020 1:00 pm

Re: Creating Apps for use on Android mobile phones

Post by Dragondos2020 » Tue May 05, 2020 5:11 pm

I cannot express my thanks enough to everyone who has contributed to this thread. I would also like to thank AxWald for contributing his in depth SQLiteAndroidDemo.

I will definitely need time to digest the information - AND really looking forward to getting to grips with all this information. Thank you so much for taking the time to provide this.

Regards

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5861
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Creating Apps for use on Android mobile phones

Post by jacque » Tue May 05, 2020 6:25 pm

Dragondos2020 wrote:
Mon May 04, 2020 5:23 pm
I will thanks, keep trying. And based on your encouragement I will not be shy in accepting additional help. I was just concerned that I was taking advantage of the generosity of more experienced LiveCoders.
We were all beginners at some point and we all took advantage of more experienced users to get where we are now. After that most of us pay it forward for the next person. We do it because we love the language and we want to help. I expect soon you will be paying it forward too.

This is one of the kindest and most thoughtful forums on the internet. We're at home here.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Dragondos2020
Posts: 29
Joined: Mon Apr 20, 2020 1:00 pm

Re: Creating Apps for use on Android mobile phones

Post by Dragondos2020 » Thu May 07, 2020 7:16 pm

Hi All

I have managed to find the time to delve into the SQLiteAndroidDemo provided by AxWald. There was certainly a number of routines which were rather alien to me. But with the added comments, I was able to start to understand what was going on.

Using the information provided I attempted to take the code on board and use within my own project. Eventually I managed to build upon the code. I introduced the DataGrid, which I was able to use to display all the records held within the database, select a record and then display the details on to a record form (15 entries per record). I was able to ADD to records, DELETE records and display a datagrid list of all records and from that list select an individual record for displaying their full details.

So far, all good. I was able to run the project within the LiveCode Environment with no problems. I was also able to run the project within the Android Emulator, again with no problems. This is the furthest that I have ever been in successfully running a program on the Android Emulator. Thank you for providing the necessary information for me to get this far.

I have tried to copy the .apk file on to my Android Smartphone. Copied fine. But when I tried to select the .apk file to install, that when a few problems occurred. Firstly, the message "Do you want to install this application? It does not require any special access." "Cancel" or "Install". Selected "Install". Here it started to install, but then stopped with the message "App not installed".

I was able to install my previous attempts (prior to receiving the SQLiteAndroidDemo application) and was able to install, but could never access the membershipdatabase.db either by viewing or adding.

I thought that maybe my project using the code and knowledge gained from SQLiteAndroidDemo, had a bug within it which prevented the .apk from being installed. So I took the opportunity of using the SQLiteAndroidDemo without any changes being made (as received) and created the StandAlone and then copied the .apk file onto my Android Smartphone. The same problem occurred, it would not install.

So, I have three questions, if I may:

1. What is preventing the .apk from being installed on to my Android Smartphone (either my project or the unaltered SQLiteAndroidDemo?

2. I notice that when I save my projects they have the ,LIVECODE file extension. Whereas, the SQLiteAndroidDemo version has the extension .REV Not sure how you decide between the two when saving, and whether it effects the finished .apk file for installing on to the Android Phone.

3. Using your SQLiteAndroidDemo, I can see how you use the database file. Displaying the contents of the database file. Adding new records to the database file. Deleting a record from the database file and viewing a record from the database file. However, I cannot woprk out how to amend /update an existing record within the database file. I have tried various variations that I know about updating a record set. But using inconjunction with your code I am unable to amend or update a record. Any pointers or examples would be great.

Thank you.
Steve

Klaus
Posts: 12216
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Creating Apps for use on Android mobile phones

Post by Klaus » Thu May 07, 2020 7:36 pm

Hi Dragondos2020,
Dragondos2020 wrote:
Thu May 07, 2020 7:16 pm
...
2. I notice that when I save my projects they have the ,LIVECODE file extension. Whereas, the SQLiteAndroidDemo version has the extension .REV Not sure how you decide between the two when saving, and whether it effects the finished .apk file for installing on to the Android Phone.
Some versions ago the app was named "Revolution" and later re-branded to "Livecode" and the suffix .rev is a remnant of that time and today LC automatically add -livecode.

So don't worry, it does not matter if you use REV or Livecode, the suffixes are interchangeable. :D

Dragondos2020
Posts: 29
Joined: Mon Apr 20, 2020 1:00 pm

Re: Creating Apps for use on Android mobile phones

Post by Dragondos2020 » Thu May 07, 2020 7:51 pm

Thanks Klaus.

Appreciate the clarification.
Regards

sphere
Posts: 1117
Joined: Sat Sep 27, 2014 10:32 am
Location: Earth, Except when i Jump

Re: Creating Apps for use on Android mobile phones

Post by sphere » Thu May 07, 2020 8:31 pm

you don't need to create an apk for testing.
You need to enable developer mode on your android (it's written in this lesson http://lessons.livecode.com/m/2571/l/27 ... er-on-a-pc)
then connect your android to your pc/mac
then the android will ask if you allow this pc

then select the android phone in LC
then hit the test button to build it and install it on your phone, you can test right away(similair to emulator, just need to select your phone)

AxWald
Posts: 493
Joined: Thu Mar 06, 2014 2:57 pm

Re: Creating Apps for use on Android mobile phones

Post by AxWald » Fri May 08, 2020 3:07 pm

Hi,
Dragondos2020 wrote:
Thu May 07, 2020 7:16 pm
1. What is preventing the .apk from being installed on to my Android Smartphone (either my project or the unaltered SQLiteAndroidDemo?
Probably the StandAlone Settings. I tried the stack with "Development/ Test" (see sphere's post above), and so didn't need to install. Additionally I see that I posted the 6.7.10 stack version, where there's other SA settings. I attached the LC 9.5.1 version that created a valid .apk for me - I had to choose both ARMV7 & ARM64, and "sign for development".
Dragondos2020 wrote:
Thu May 07, 2020 7:16 pm
2. I notice that when I save my projects they have the ,LIVECODE file extension. Whereas, the SQLiteAndroidDemo version has the extension .REV
They are interchangeable. I prefer to use .livecode for the new (beta) versions, and .rev for (stable) 6.7.10.
Dragondos2020 wrote:
Thu May 07, 2020 7:16 pm
3. Using your SQLiteAndroidDemo, I can see how you use the database file. Displaying the contents of the database file. Adding new records to the database file. Deleting a record from the database file and viewing a record from the database file. However, I cannot woprk out how to amend /update an existing record within the database file.
It's quite easy - check the script of the buttons. It comes down to this:

Code: Select all

   put "Whatever you want to send to the database, in valid SQL;" into StrSQL
   get doSQL("MDB",StrSQL)
Then check "it" if all was OK, or what was returned. "doSQL()" does all the work for you.
For changing records you'll use "INSERT" or "REPLACE", and you'll want to learn to construct "VALUES" strings.

Basically you create a valid SQL string, test it in your db manager, and then re-create it in LC, inserting variables for the various values, as in:

Code: Select all

put "DELETE FROM `members` WHERE id = " & myID & ";" into StrSQL
What's in StrSQL is what's sent to the db, and must run in the db manager, too - this way you can test it.

For sure, working with SQL databases requires at least intermediate knowledge of SQL. But learning the basics (table design, JOINs, views and the other basic syntax) is not this hard, and reading here will help. What's important, IMHO, is a good db manager as well as a powerful text editor. A good choice here can help a lot.

Have fun!
Attachments
sqliteandroiddemo9.zip
same as before, just as LC9
(9.15 KiB) Downloaded 67 times
Livecode programming until the cat hits the fan ...

Dragondos2020
Posts: 29
Joined: Mon Apr 20, 2020 1:00 pm

Re: Creating Apps for use on Android mobile phones

Post by Dragondos2020 » Fri May 08, 2020 5:47 pm

Wow! Its like being back at College. All this new information coming from all angles, just to help me in my quest. Just loving it! That might not be a 'cool' saying. But I am truly overwhelmed by the generosity of you all in ensuring that I have a better understanding.

I now do have a much better understanding. I can actually see the light at the end of the tunnel, and the future looks bright! I have turned my Android Phone into development mode. I am running the project on the phone. All appears to be working fine. Now I am able to work more on the interface and add more features into the project.

Thank you ALL for your patience, understanding, and encouragement. It really has been appreciated.
Best Regards
Steve

Post Reply

Return to “Android Deployment”