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
Related
I am getting started with flutter. After a day of installing all the required stuff and running an android emulator for the first time, I figured that my pc is not powerful enough for running android without significantly slowing down the computer.
(Nope, I cant upgrade my pc.)
I was wondering if there is any way I can do flutter on my pc. Any way to get something like ui output on dartpad.
I am using VSCode.
If you have an android phone, just turn on developer mode and USB debugging on it and connect it to your computer and click run. Then the apk file will be installed on your phone and it will instantly change states whenever you click run. If you don't have an android phone you can easily get a decent one for just under $50.
If you have physical android device, you can connect it to your computer. and type flutter run in your terminal.
or
use flutter web(beta) type flutter run -d chrome in your terminal.
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! :)
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/
Sorry to be cheap But I have a chinese Android 4.0.3 tab .I have no idea how to test my app on this device other than copying the apk file to the device and install it, It is very lengthy process . Is there any way I could directly run the app using apk Like other brand devices.
Can anyone help me?
Using adb tools you can install your app directly to your android device,
adb install <aaa>.apk
but do this process you need configure adb tools in your envirnment and check your device manufacture sapport for that, configure adb
http://esausilva.com/2010/05/13/setting-up-adbusb-drivers-for-android-devices-in-linux-ubuntu/
check under USB Vendor IDs in above url to check your android manufacture support for that
Aslong as it has USB driver support you can debug direct to the device, however failing that, i dont see why you couldn't when you wish to test build to a 'Test APK's' folder then use a .bat to do the lengthy steps for you with regards to copying to the device.
I have made a program on eclipse. But how can I get the program from eclipse to my phone? I have a cable because it probably wont make a QR code like appinventor does huh. How do i install my app on there?
You need to set up your machine and phone for running and debugging from eclipse. It involves getting the phone's usb driver on your machine, and setting up the phone for usb debugging.
Read this Using Hardware Devices | Android Developer Guide
You can simply export the apk file and copy it to your phone. Email it to yourself, bluetooth transfer, upload to a server then download on your phone.... come on.
You just have to allow the device to accept nonsigned apps and USB debugging (change this in your device's app configuration). Then, if you have the drivers (you can install them within your AVD), you can just run the app from Eclipse in your phone.
In Windows you will need drivers to install for the particular device that you have. And if you are on Linux, there is a rules.txt file in which you have to make entries with the device UID. Check this link.