Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, March 6, 2014

A Better ADF Mobile Development Experience on Android

Silly me, i forgot to publish this post that i wrote back in August :)

ADF Mobile developers will relate to this when I say, the Android Emulator is the definition of "painful". A day in a typical life of an ADF Mobile developer working with Google's Android Emulator is:
Develop an app in JDeveloper. Start the deploy process. 7 minutes later the app is deployed - unless you use the release mode trick i showed you. Next, go to your emulator start the app launch process. And 10 minutes later you'll get to see your app... as you later realize you forgot to write a critical line of code - and you die a little bit inside.

Unless you intend on playing a game of cricket or grill hotdogs and hamburgers for your office during each deployment cycle, you're probably itching to get your hands on a more efficient emulator. This is your answer.

AndroVM or what it will later be called, Genymotion. Genymotion will be a commercialized version of AndroVM. AndroVM is a product which runs on Oracle's virtualization software, VirtualBox. While, this is not supported by ADF Mobile and has some shortcomings, as reported by ADF Product Manager Chris Muir, it definitely eases the pain of quickly testing code you write for your ADF Mobile application.   As a AndroVM user, I can testify that apps run wicked fast compared to the emulator. Below are steps on how you can get started with AndroVM and ADF Mobile.


  1. Download and Install Virtual Box. I installed version, 4.2.12.
    Download Link: https://www.virtualbox.org/wiki/Downloads
  2. Consult the AndroVM Documentation and download an AndroVM with gapps & houdini & flash.
    vbox86p VMs are built for Phones, 480x800 default resolution
    vbox86t VMs are built for tablets, 1024x600 default resolution
    vbox86tp VMs are tablets with phone capabilities, 1024x600 default resolution.
  3. Once the AndroVM is downloaded, double click on it to import your AndroVM into VirtualBox. I accept all the defaults.
  4. Before you start AndroVM, you need to update the Network Settings to allow the Android SDK to connect to the VM. Select your VM, click on Settings > Network > Adapter 1. Set the Attached To field to Host-only Adapter. Click OK.


  5. Startup the AndroVM
  6. Allow approximately a minute for Android to boot up.
  7. For the first time starting up Android, you'll be prompted to specify your android settings, as you normally would during an initial Android boot process.When you complete the first time configuration settings, your screen should look like the screen below. From here, you're ready to deploy apps onto AndroVM!
  8. From there you're ready to deploy apps onto the AndroVM!






Thursday, May 16, 2013

JDeveloper and Android SDK Incompatibility

While writing a quick test ADF Mobile app to verify a new training pc, I ran into an ADF Mobile deployment error below:

Cannot run program "... platform-tools\aapt"
CreateProcess error=2, The system cannot find the file specified.



This started happening because Android SDK Tools was updated from Rev. 21.1 to Rev 22. 


What revision 22 did was it moved aapt.exe to a different directory. The catch is that you can't configure or tell JDeveloper where to find this. 

To fix the issue, I took my SDK version back to Rev. 21.1, by extracting the Rev 21.1 zip and using that one. I did have to re-install/load the Android API, but 10 minutes and i was back in business. However, if you want use Rev 22, copy the contents of %SDK_Home%/build-tools/android-4.2.2 to %SDK_Home%/platform-tools. The only downside of this, is that Android SDK won't be able to maintain/update the platform-tools section. Which is why i'm using Rev 21.1 - theres nothing significant that you're missing by sticking with Rev. 21.1 vs Rev. 22.

Until Oracle changes how JDeveloper can find these libraries, you can use this workaround!

Update (05/21/2013): Per Chris Muir, ADF Product Manager, this issue has been officially logged at Oracle as a bug 168376554. They're working on it!
Source: https://blogs.oracle.com/onesizedoesntfitall/entry/adf_mobile_deploying_to_android





Silly JDeveloper - Android SDK Location Change

I was briefly tricked by this for a few minutes. And there's bound to be at least one other person out there whom will get tricked as well. This is for you :)

It appears Android made a slight change in their file structure. As a result, it sort of tricks JDeveloper and otherwise you as the developer, when its time to configure your Android SDK settings.

When selecting "Android SDK Location" under "Preferences > ADF Mobile > Platforms > Android", you are asked to select "%Root_Drive%/Android/android-sdk" for the location, like for example "D:\Android\android-sdk".

For some of you, selecting the suggested path by JDeveloper, you'll be greeted with an error message "Unable to locate Android SDK in the specified location %some_path%. Do you want to use the specified Android SDK location anyway?"




This is because, I had to select the "Android/android-sdk/sdk" directory, instead of "Android/android-sdk", as shown below.



Selecting the proper SDK location, lets you continue error free :)

Have fun ADF Developers!