IBM Worklight - Installing applications on a device - android

We are currently using Worklight Enterprise Edition running in Windows. We created a mobile application using jQuery Mobile (and another Using Dojo Mobile) but we were unable to deploy it to a the device.
After developing the application we generated the (unsigned) .apk file
We copied it to Samsung Grand (android version 4.1.2) to test it
When we try to open the .apk file, we get the error: There is a problem parsing the package.
Is this the correct procedure to install the .apk file in device?

Try the following:
Make sure the device is setup for development. Follow these instructions to enable so.
Connect your device to the computer using a USB cable
In Eclipse, make sure that the device is recognized in the Devices view (Ctrl+3 and search for "Devices" to add the panel).
Right-click on your Worklight application and choose Run As >> Build All and Deploy
Right-click on the generated Android project (should appear below the Worklight project) and choose Run As >> Android Application
This will generate an unsigned .apk and install it onto the device.
Observe LogCat (Ctrl+3 and search for "LogCat" to add the panel) for errors.
If you cannot connect the device to the computer:
Make sure the enable the option to allow installing applications from "Unknown Sources".
Setup an email account on the device and email the .apk to yourself. Tapping the attached .apk should then install it.
Alternatively, and only if your device is rooted, you can use an app called ADB Wireless, which allows remote installing and debugging of applications.
As a final attempt,
From the Android SDK Mananger, install API Level 8.
Go to the android\native\AndroidManifest.xml file and change minSdkValue to 8.
Build and deploy, install on device.

Related

How to try an app on a tablet

I am doing some applications using Android + Eclipse to run on tablets. I have had too much trouble with the tablet emulator, so I would like to try my code (apps) on a real tablet. How can I do this? I have a Samsung Galaxy Tab 3. Do I need to install the adt-bundle on it?
I'd appreciate any input.
http://developer.android.com/tools/device.html
You just need a usb cable to connect your device to your pc.Go to the above link for more info
check this it may help you Run on a Real Device
Here is a copy paste, but check the link it's really good and well explained :
If you have a real Android-powered device, here's how you can install and run your app:
1-Plug in your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the OEM USB Drivers document.
2-Enable USB debugging on your device.
On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
On Android 4.0 and newer, it's in Settings > Developer options.
Note: On Android 4.2 and newer, Developer options is hidden by default.
To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
To run the app from Eclipse:
1-Open one of your project's files and click Run from the toolbar.
2-In the Run as window that appears, select Android Application and click OK.
Eclipse installs the app on your connected device and starts it.
Or to run your app from a command line:
1-Change directories to the root of your Android project and execute:
ant debug
2- Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute:
adb install bin/MyFirstApp-debug.apk
3-On your device, locate MyFirstActivity and open it.

Android development without ADT

Can I write an app in a .apk file and install it on my device by just transferring it and then open it on my phone? Can I avoid the frustrating complexity of Eclipse and ADT?
Background:
I decided today I wanted to learn developing Android apps. I downloaded the ADT bundle and then spent half the day trying to connect my device so I could run a premade Hello World app on it. After much failure I am frustrated and just want to start writing code.
This is something I have tried to avoid whenever I develop an Android app. The easiest way to do so is just to email it to yourself or to put it up on a website using an FTP client. From there, you can just download the
apk
and then install it. You do, however, have to turn on "Installation from unknown sources" so that you can download apps from places other than the Google Play store.
If you email the .apk to yourself and enable Install from unknown sources then you should just be able to tap on it as an attachment in the email, install it and run it.
Similarly, you could install a file manager app, transfer the .apk and open it from there.
Personally, I find IDEs can be a very resource hungry, slow and unnecessary when I'd much rather use Sublime Text for editing and gradle and adb on the command line to build, install and debug apps - which is infact what I do, so you may want to give it a go.
It sounds like you might just be having issues connecting a device. You can and should first get that working outside of Eclipse. You don't mention which host OS you're using, but you'll need to do the following. If you get stuck on any step, just ask.
Install the Android SDK.
Add the tools to your path.
If on Windows, install the USB driver for your device.
Connect your device with a USB cable.
Enable USB debugging on your device.
Open a command or terminal window.
Run adb start-server; adb devices.
Verify that your device is listed.
If your device is listed, then you've successfully connected your device and can use ADB commands to directly install APKs via USB.
As an alternative to Eclipse/ADT, you can try the new(ish) Android Studio, which is built on IntelliJ Idea.
There's no getting around the Android SDK and all of its tooling if you want to develop an Android app, but Android Studio can potentially do a better job of hiding those things from you.
#Tom Leese's answer is the way to go to install an APK on your phone, but you can't really avoid the tools in the long run. Eventually you'll have to debug, which will require you to get ADB working.
Try develop with AIDE.
AIDE is an integrated development environment (IDE) for developing real Android apps directly on your Android device

Do I need to root my Android mobile to run my own applications?

If I write an application using the Android SDK or NDK, can I simply copy the APK produced onto any Android phone (with the right version of the OS running) and run it? Or do I need to root the phone before apps not bought through a marketplace can run?
The context is that I have the choice of a Galaxy S2 as an upgrade to my iPhone4 and I'd like to start writing my own stuff. I can find plenty of instructions and examples of compiling and running apps in the emulator, but nowhere explicitly states I can run the apps I compile on the S2. I'm worried that apps may need to be signed or authenticated before they can run on it (and other phones) and I'd rather not mess about with the phone too much.
You can download it and run it without root.
You can debug directly on a device even from your development environment.
Android development tools environment (ADT) in eclipse (as well as others) and the correct ADB USB drivers for your phone gives you that nice option. Much faster than using the android emulator too.
In settings you have to allow debug (a simple checkbox), that is all.
No you don't need to root. Just install drivers and SDK. Using eclipse you can directly run on device and debug too
it's also faster than working on emulator
If you get Galaxy S2, then you can install Samsung's own free app, "Kies Air". This allows you to transfer files over wifi from your PC to anywhere that you can see in the phone's file explorer. If you transfer an apk this way, then when you click on it in the phone's file explorer, it will install the app. The app can be signed with a debug key, or a release key.
You don't need root. In order to instal on android phones you simply install the app on the phone through eclipse ADT tool or just through the ADT terminal. Just remember to set the phone to development mode by going into settings -> programs, then allow installing from unknown sources.
Alternatively if you want to install the *.apk on you device download an app from market. Follow this link for guides on both this approach and the SDK/debug approach: http://www.talkandroid.com/guides/beginner/install-apk-files-on-android/

how to run the android application in device?

i have android device, how can i run the application connecting with my system instead running in the emulator.
Connect your device via USB to your computer:
http://developer.android.com/guide/developing/device.html
And then adb should use preferentially the hardware device over the emulator.
http://developer.android.com/guide/developing/building/building-eclipse.html
Automatic and manual target modes
By default, a run configuration uses
the automatic target mode in order to
select an AVD. In this mode, ADT will
select an AVD for the application in
the following manner:
1) If there's a device or emulator already running and its AVD
configuration meets the requirements
of the application's build target, the
application is installed and run upon
it.
2) If there's more than one device or emulator running, each of which meets
the requirements of the build target,
a "device chooser" is shown to let you
select which device to use.
3) If there are no devices or emulators running that meet the
requirements of the build target, ADT
looks at the available AVDs. If there
is an AVD that matches the build
target of the project, ADT chooses
that AVD. If the AVD versions are
newer than the build target of the
project, ADT chooses the oldest
possible version of an AVD that meets
the project's build target
requirement.
4) If there are no suitable AVDs, the application is not installed a console
error warning tells you that there is
no existing AVD that meets the build
target requirements.
However, if a "preferred AVD" is
selected in the run configuration,
then the application will always be
deployed to that AVD. If it's not
already running, then a new emulator
will be launched.
If your run configuration uses manual
mode, then the "device chooser" is
presented every time that your
application is run, so that you can
select which AVD to use.
You have 2 options:
Via ide plugin. Eclipse and IDEA both are able to lauch and debug applications on the real devices, only thing you need is the driver installed for your mobile.
Via apk. Just make an apk, copy it to sdcard, and install it from your device using some file manager like ASTRO.
You can also do it in another way. Attached your .apk file and mail it to your mail account. Then login to your account(account that you send the .apk file) on device, download the .apk file and install it on your device.

Android Install Eclipse project onto DeviceAnywhere

How can I install an Eclipse Android project onto deviceanywhere to test on different devices?
Thanks
Chris
You have to upload your apk to a webserver somewhere, then browse to it from the device anywhere device, download the apk, and install it. Make sure the device has "install from unknown sources" allowed in the settings.
Have a look on virtual usb. According to DeviceAnywhere blog you can do that.
And re AT&T - even without unknown sources option you can still install application using usb debugging mode.

Categories

Resources