Problem Android Installation and Emulated Device on Win

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Hans-Helmut
Posts: 57
Joined: Sat Jan 14, 2017 6:44 pm

Problem Android Installation and Emulated Device on Win

Post by Hans-Helmut » Sat Apr 15, 2017 1:32 pm

Using Windows 10, 64bit
LiveCode LC9-dp6
Java jdk1.8.0_121 (current version, installed default)
Android SDK: tools_r25.2.3-windows (current version)
===

I am fighting with Android deployment for days. I read everything about it I could find.

After numerous problems getting it partially to work, yesterday I was able to successfully create the first APK file and was able using Google Drive to install it successfully on my phone (Samsung S7 edge). It took a huge effort to come to this stage.

After several more hours trying to get any virtual device working and deploying this using LiveCode, I am giving up and hope to find some hint or explanation here.

===
1. The emulator works and is visible.
2. All is installed and LiveCode is capable of creating an APK file that runs on a physical device.
3. In the LiveCode IDE: Menu "Development", sub-menu "Test Target", the virtual device "Android Emulator - AVD_1:5554" can be selected.
4. Running the "Test" button the window "Standalone Builder Progress" appears.
5. Never so far the building process finishes successfully. A window with an error message appears.
===

There is a failure regarding some failed path settings. It is correct that the mentioned file path does not exist, but I do not see any way of how to make LiveCode or Android JDK aware. See screenshot.

Help is highly appreciated!
Hans-Helmut
LC Build Error.JPG
Error message after trying to build for emulated Android device
LC Build Error.JPG (34.39 KiB) Viewed 4572 times

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

Re: Problem Android Installation and Emulated Device on Win

Post by jacque » Sat Apr 15, 2017 5:26 pm

What is the minimum version of Android your app requires? Is the emulated virtual device created with the same or newer OS?

I think many of us have given up on using the Android emulator, it's too slow and dodgy. You'll get better results just sending the test app directly to your phone. You can cable the phone to your computer and use it just like the emulator after some minor setup. Or I just use your method of moving the built apk to the device via a cloud service.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Hans-Helmut
Posts: 57
Joined: Sat Jan 14, 2017 6:44 pm

Re: Problem Android Installation and Emulated Device on Win

Post by Hans-Helmut » Sat Apr 15, 2017 10:15 pm

Post by jacque » Sat Apr 15, 2017 4:26 pm
What is the minimum version of Android your app requires? Is the emulated virtual device created with the same or newer OS?
Dear Jacque

The minimum version is 4,4 KitKat. I am already now using a USB cable to directly copy the file to the phone. This works fine.

Roundtrip

It is not so convenient testing an app as with our LiveCode desktop IDE:

- Making changes (whatever time it takes)
- Compiling (1 minutes currently)
- Uninstalling the previous version
- Installing the file (15 seconds)
- Installing the new one (30 secs)
- Running and testing (whatever time it takes)

Question: Is there any way to automatically close a running app in the Android phone sending commands from outside, uninstalling the app and deploying a new one? It would be great from within LC, but any other tool could help here.

Emulator

Still, even if I would not be using the emulator, I just would like to see that it is working at least... otherwise, would it be a bug? But I think something must be wrong - but I have no clue what it could be having tried all kinds of settings, even setting System variables, just everything I could imagine or read about. Starting up a new emulated device takes quite a time in the Android SDK, at it also does not look too stable.

Is the minimum version too high? But before, I even tried using 2.3, but also no success.

Hans-Helmut
Posts: 57
Joined: Sat Jan 14, 2017 6:44 pm

Re: Problem Android Installation and Emulated Device on Win

Post by Hans-Helmut » Sun Apr 16, 2017 7:21 pm

For those interested, I found a nice article about Android SKD and deployment which for me gave an idea of what we are doing here...

http://www.vogella.com/tutorials/Android/article.html

I think it is helpful, if not necessary, to have some more background information and not just instructions on what to do (with some beginners scripts which do not go very far) because things are changing so quickly, tutorials may be outdated quickly, and if there is no broader understanding, you would easily be left out and need many hours to fight little problems.

So, I am now trying to figure out what could cause such error messages and also I am trying to get an idea of what LiveCode is actually doing behind the curtain when compiling for Android or iOS.

AND HAPPY EASTER TO ALL :D
Hans-Helmut

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

Re: Problem Android Installation and Emulated Device on Win

Post by jacque » Sun Apr 16, 2017 9:57 pm

Hans-Helmut wrote: The minimum version is 4,4 KitKat. I am already now using a USB cable to directly copy the file to the phone. This works fine.
Is your virtual machine using that version of Android? If your virtual machine is a lesser OS it won't run your app.
It is not so convenient testing an app as with our LiveCode desktop IDE:

- Making changes (whatever time it takes)
- Compiling (1 minutes currently)
- Uninstalling the previous version
- Installing the file (15 seconds)
- Installing the new one (30 secs)
- Running and testing (whatever time it takes)
The steps are the same whether you compile to a phone, to an emulated device, or to a standalone, except that in the emulator everything will take twice as long. It's very slow (though I haven't used it in about 3 years so maybe it's faster now, but I don't bother with it. Other methods are quicker.) You can eliminate uninstalling the previous version by changing the version code in standalone settings. If the version code in the installed app is different from the new one, the new app will automatically replace the older one. You don't have to manually remove it.

I don't know of any tools that will remotely install an app to Android. That would be a security risk.
Still, even if I would not be using the emulator, I just would like to see that it is working at least... otherwise, would it be a bug? But I think something must be wrong - but I have no clue what it could be having tried all kinds of settings, even setting System variables, just everything I could imagine or read about. Starting up a new emulated device takes quite a time in the Android SDK, at it also does not look too stable.
It takes several minutes to start up a virtual machine, that is normal. Everything you do in the emulator will take much longer. But you can reduce the startup time by ticking the "snapshot" checkbox in the dialog where you create the virtual machine. That will save a disk image that loads faster after the first startup.
Is the minimum version too high? But before, I even tried using 2.3, but also no success.
It isn't too high. I don't support anything less than 4.4 any more.

Edit: The error about "older SDK" could mean that your virtual machine is running a version of Android that is older than your app's minimum version requirement. If that is the case, then the directory would not be found because the app would never have been installed.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply