How do I convert eclipse App for phone? - android

I have downloaded eclipse and the Android sdk and I have now used eclipse to design an android app which runs fine on the emulator. I have also downloaded and installed Kies for file transfer between PC and Samsung phone. I used Kies to download a free app from Android market and checked the format of the downloaded files, one is an ‘app file’, the other is ‘image files’. Do I have to somehow turn the saved files from my eclipse created app into the above file types for transfer to my phone? If so how? If not, which files do I transfer to my phone?
Hope someone can help, apologies if I have missed something simple and obvious. Thanks.

If you're just looking to test/debug your app on your own phone, then you can do that straight from Eclipse's Run menu once you've set up your environment properly. See Developing on a Device from the Android developer site.
There's also information on signing and publishing your app to the Market.

You just have to enable "Usb debugging mode" under settings\application in your phone.
If you have the android sdk, the phone drivers and the eclipse android plugin properly setup you should be able to debug your application in your phone using eclipse.

Related

Unable to detect android phone via adb

I am using Adobe Flash CS5.5 to develop flash air applications on Android. However, I just can't seem to get my phone visible to Flash.
I have a Samsung Galaxy GT-N7000 (Galaxy Note). I have rooted the phone with cyanogenmod 10.1.3-n7000. I have enabled "usb debugging" in the phone settings.
I'm running this on Windows 7 Professional 32-bit.
When I connect my phone to the PC, I am able to see it as GT-N7000 under Device Manager -> Portable Devices heading. I am also able to copy files to/from this device without any issues.
The adb version installed on my system in the flash installation folder is 1.0.26. When I try to run the flash animation on my phone, it can't seem to detect it. I get the error message
"Could not find an android device to connect to. Please ensure that you have the phone connected, the correct drivers installed, and the phone has USB device debugging enabled".
I'm at a loss for how to install the usb driver, as mine is a galaxy note, but is using cyanogenmod. I couldn't find the SDK manager in the flash installation folder, but ran the SDK manager from the android-sdk folder which I have parallel installed for developing android applications using Android Studio. I installed the Google USB drivers from that location. I'm not sure if this will help Flash detect the phone.
I have also tried using the usb connection mode as MTP, PTP, as well as mass storage. But no difference.
What else could be the issue? Any pointers? Please excuse me if any details are missing. I'll add them as they are pointed out.
UPDATE: Found a similar query at Android Device Connectivity in Adobe Flash Pro CS6 Win7 x64.. However, doesn't work for me! :(
Workaround (well, sort of!):I am able to copy the .apk file to the phone memory, and then install it. I had to enable "Unknown Sources- Allow installation of apps from unknown sources". However, I am still not able to publish directly to the phone, nor am I able to debug it from Flash.
Solved it! Since Flash connectivity didn't seem to be working, I thought it better to see if I can at least make Android Studio work with my phone. Tried all the stuff possible, including using the SDK Manager to install the Google USB Driver. Nothing worked.
Since my phone IS a GT-N7000, but with CyanogenMod, I thought that the Samsung USB driver wouldn't work for it.
Finally, after trying a lot with all the other methods, I did the simplest thing possible. Found the Samsung GT-N7000 usb driver (downloaded from the mirror link in this XDA forum post http://forum.xda-developers.com/showthread.php?t=1755001), installed it, and EVERYTHING started working! Flash, Android Studio, etc!
For those who don't want to download just the drivers, or are hesitant to download from unverified links, you can download and Install Samsung Kies, and it'll do the required installation of correct driver!
Duh! Sometimes, the simplest things are the only steps required!
NOTE: Please see my first answer for a simple way to solve this. If this doesn't work for you, you can try the steps documented here.
I'm posting follow up problems and how I resolved them. Since this update was rather long and might not occur for others, I have posted it as a separate answer. It is still pertinent to this question, so I have kept it as an alternate answer.
**
Moderators: please let me know if there is a more elegant way of doing this, and I will do the needful.
**
UPDATE: I had uninstalled Flash for some reason, and re-installed it again after two months or so. However, I found that I was unable to publish to the phone after this. Resolved it finally as below.
Sometimes, even after the device drivers get installed, and show up in device manager as an adb interface, you might not be able to publish to the phone. Ensure that you have enabled "developer options" in the phone, and that "USB debugging" option is enabled. This might solve your problem.
However, in my case, this didn't work. Flash was just stuck at the "Publishing" phase, and didn't proceed to launch my project on the phone.
In such a case, open up a command prompt (in windows) and query the devices using the command "adb devices".
If the device shows up as "offline" status, try connecting the phone to another port. Again, this too didn't work out for me.
Finally, I updated the Platform SDK on my machine using the "SDK Manager". Once updated, I re-ran the command "adb devices" on the command prompt, and voila! The phone is now listed properly without any "offline" status.
Now the problem! The problem is that Flash CS5.5 uses an old version of the Air runtime (which comes with it's own version of adb.exe). In order to update this, I downloaded the latest version of AIR SDK from http://www.adobe.com/devnet/air/air-sdk-download.html. However as Flash 5.5 doesn't have a straight-forward way to use the latest version of the SDKthere were some steps that I had to follow to do so. The original document is at http://code.tutsplus.com/tutorials/enable-the-latest-air-sdk-in-flash-professional-cs55--active-11488, but I am inlining it here based upon my own changes to the steps mentioned in the web page, as well as to ensure that these steps don't become dead links later on.
Step 1: Download the Latest SDK
Download the latest AIR SDK from the following link: http://www.adobe.com/products/air/sdk/
Extract the downloaded file into a separate folder on your desktop
Step 2: Backup Your Current SDK Folder
Go to the Adobe Flash CS5.5 installation folder (
should be "C:\Program Files\Adobe\Adobe Flash CS5.5" on 32 bit Windows,
"C:\Program Files (x86)\Adobe\Adobe Flash CS5.5" on 64 bit Windows, and
"Applications/Adobe Flash CS5.5" on OS X).
Rename the AIR2.6 folder to AIR2.6_OLD.
Create a new folder and name it AIR2.6.
Step 3: Create the New SDK Folder
Copy the contents of the latest AIR SDK folder (that you’ve created on your desktop) to the AIR2.6 folder.
Browse to the AIR2.6/frameworks/libs/air/ folder in the Adobe Flash CS5.5 folder and copy the airglobal.swc file.
Paste the SWC file into Adobe Flash CS5.5/Common/Configuration/ActionScript 3.0/AIR2.6/, overwriting the existing airglobal.swc file.
Step 4: Final Configuration Settings
Go to Adobe Flash CS5.5/Common/Configuration/Players/ and open the following files using a text editor
(you may need administrative privileges to edit these files in the application folder in Windows):
AdobeAIR2_6.xml
AiriPhone.xml
Android.xml
NOTE: Player element and how to point it to the right version. Go to https://helpx.adobe.com/air/air-releasenotes.html and start counting from
2.6 version as 11, to the version updated by you, incrementing every time you see a "user release notes" for each version. For easier reference,
version 19 should be considered as version 30.
Change the version attribute of the player element from 11 to this calculated version (30 in my case) in each file.
Don’t forget to save them after you’re done editing.
Restart Flash, and try publishing to the phone. It worked for me! :)

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/

app is not running in tab but running fine in phone?

I have downloaded some sample source codes, modified them and made a audio-video player.
The player is supporting minimum Android version 2.2. I ran the app in my tab, as well as phone.
It's working fine for my Android phone, but not in my tab. I am not sure why this is happening.
I am not even able to install the .apk file in my Android tab.
Can anybody suggest me what may be cause of this?
In order to install apps from places other than the market, you need to enable that in Applications settings - allow unknown sources. enable it.
enable usb debugging also
With the debug tools installed, you can install an apk from the command line by saying
adb install my.apk.

How to deploy my Android project and how to test on my device

I'm a beginner for Android Development. So, i have need to deploy my Android project and how to install into my Android device. (like, mobile, tab.. ) I have a Android mobile xperia x10.
Please help me.
thanks in advance.
First option is to use your IDE. Eclipse(with ADT) and IntelliJ Idea supports deployment on device. THe only thing you should have installed is mobile phone driver. HTC, for example, has it on it's sdcard.
Second option is just copying an apk file to your sdcard and installing it by invoking apk from some file manager like ASTRO.

Categories

Resources