[Q] Setting up Eclipse with ADT Plugin - Android Software Development

Hi everyone,
I have a problem with Eclipse. I'm just starting out with Android development. I downloaded Eclipse with the ADT Plugin like it says on the Android dev site.
I managed to complete two tutorials, the hello world and layouts ones. They compiled and are now on my phone as normal applications.
However for some reason I can no longer do this, when I go to run the program I get this error from the console:
Code:
2010-12-10 16:06:21 - HelloL10N Android Launch!
2010-12-10 16:06:21 - HelloL10N adb is running normally.
2010-12-10 16:06:21 - HelloL10N Performing com.example.hellol10n.HelloL10N activity launch
2010-12-10 16:06:21 - HelloL10N Automatic Target Mode: using device 'HT03KPL01672'
2010-12-10 16:06:21 - HelloL10N Uploading HelloL10N.apk onto device 'HT03KPL01672'
2010-12-10 16:06:21 - HelloL10N Installing HelloL10N.apk...
2010-12-10 16:06:21 - HelloL10N Installation error: INSTALL_FAILED_MEDIA_UNAVAILABLE
2010-12-10 16:06:21 - HelloL10N Please check logcat output for more details.
2010-12-10 16:06:21 - HelloL10N Launch canceled!
I assume it's related to my phone (HTC Desire rooted with LeeDroid 2.2d) being plugged in. The emulator just doesn't work for me so I tried using my phone instead. I'd rather use my phone anyway for now.
I've tried re-installing Eclipse, to no avail.
When I plug my phone in and select disk drive, my computer comes up with a prompt something akin to 'scan and fix', does that mean there's a problem? I got the two previous apps to work fine on it.
Although I did the check disk scan, it completed fine and I still get the error.
Does anyone have any ideas on how to fix this?

I tried changing the connection type to 'charge only' and it worked... Strange. That shouldn't happen, right? I had it on 'disk drive' for the other projects.

i'm stuck at trying to get HelloWorld to show up in the emulator. No app installs on the emulator? Any ideas?

i'm stuck at trying to get HelloWorld to show up in the emulator. No app installs on the emulator? Any ideas?
Click to expand...
Click to collapse
What says the log output after clicking the Run Button in Eclipse.
Switch to the DDMS perspective in Eclipse and click on the tab "Console".
A normal output after clicking on the "Run Button" is something like this:
Code:
[2010-12-19 12:37:38 - adb is running normally.
[2010-12-19 12:37:38 - YourTemplate] Performing eu.sample.android.sample.MainMenu activity launch
[2010-12-19 12:37:39 - YourTemplate] Uploading YourTemplate.apk onto device 'emulator-5554'
[2010-12-19 12:38:15 - YourTemplate] Installing YourTemplate.apk...
[2010-12-19 12:38:19 - YourTemplate] Success!
[2010-12-19 12:38:19 - YourTemplate] Starting activity eu.sample.android.sample.MainMenu on device emulator-5554
[2010-12-19 12:38:21 - YourTemplate] ActivityManager: Starting: Intent

This is what I get when I run the program.
Code:
[2010-12-20 21:50:43 - HelloAndroid] ------------------------------
[2010-12-20 21:50:43 - HelloAndroid] Android Launch!
[2010-12-20 21:50:43 - HelloAndroid] adb is running normally.
[2010-12-20 21:50:43 - HelloAndroid] Performing com.example.helloandroid.HelloAndroid activity launch
[2010-12-20 21:50:43 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'my_avd'
[2010-12-20 21:50:43 - HelloAndroid] Launching a new emulator with Virtual Device 'my_avd'
Here's the code. I tend to type out code instead of copy-paste since I like to get a grasp on the code itself.
Code:
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
Also how do you change to DDMS perspective? I'm not all too familiar with eclipse and it's intricacies. I've used it before but since I'm working with android it's all a little new and it's been prob over a year since i've coded anything. lol.
EDIT: Good old googleing solved that ddms issue. although other issue still stands. cheers

I'm slowly going through this tute.
HTML:
http://www.vogella.de/articles/Android/article.html#overview
has anyone else gone though this? is it any good or does anyone know of any other tute that will set me on the right track???

I am not the sharpest tool in the shed guys, but here is my 2 cents
When I started (a very short time ago, and before the eclipse upgrade recently) I had to go into my SDK Manager and create AVD's that I wanted to use.
My Eclipses never...ever...launched an AVD by itself, I had to create one, then start it, then click my run button in Eclipse and off I went.
After the Eclipse upgrade, I still have to Start my AVD myself, but now it tells me there is no AVD...etc..blah...I click the "no" option and it brings up a window showing me available AVD's and I select the one I have running. It's an extra step, but I really don't care because I can still run everything I need on my emulators.
all the best

thanks luvinandroid i've given that a go. it don't seem to rectify my issue of my app not showing up in the emu.
i've still been following that tute from my previous post and gotten up to running it. but still no avail. maybe i've set eclipse and android incorrectly. i've chosen to dev with 2.2 since that what is running on my sgs.
i'm kinda lost since i've used two different references in setting eclipse and android.
???

Related

Problem running SDK in Ubuntu 10.04

Hi I am having two problems with the Eclipse ADT.
I downloaded OpenJDK 6 bin, and installed.
I downloaded the starter package and added it to my PATH environment variable.
I installed the ADT plugin from within Eclipse with the link provided on the guide.
and I added the platforms.
However, I get two errors. One, I can not see the build target selection widget in 'New Android Project' although, I can access it with the tab key and activate a selection with the spacebar. And two, when I click finish I get an error message with no message text.
Here is a screenshot
Check this!
www rikez com/?p=774
www talkandroid com/android-sdk-install-guide/
Br: 25011

Android - emulator-5554 disconnected!

Hi all,
How to rectify this error. i have error message when i run android application
Android Launch!
adb is running normally.
Performing com.blutoothapplication.blutoothapplication activity launch
Automatic Target Mode: Preferred AVD 'wirelesssdandroid' is not available. Launching new emulator.
Launching a new emulator with Virtual Device 'wirelesssdandroid'
New emulator found: emulator-5554
Waiting for HOME ('android.process.acore') to be launched...
emulator-5554 disconnected! Cancelling 'com.blutoothapplication.blutoothapplication activity launch'!
Sometimes its running good and sometimes its shows an error...

New Ubuntu Update 10.10 Broke my SDK?

[Q] Hey guys, I just updated to Ubuntu 10.10 and now my SDK is gone! I tried to look into why it wasn't working and the software manager tool in Eclipse says that Android is installed. I don't even have any of the Android SDK buttons showing anymore? Can someone help a fellow dev?
[SOLVED] Go to the eclipse website, download Eclipse for linux, uninstall your old eclipse, extract your new eclipse wherever and go into the folder and click the application button titled eclipse. Then reinstall all the android stuff.
At the informal android developer's meetup tonight, there were two of us with this same problem.
One issue that I found was that PATH in .profile got broken.
We suspect that using the version of eclipse that came with ubuntu, rather than 3.5 downloaded directly from eclipse might also be causing problems.
I have the same problem; ellarsee, can you be more specific how you got it running again?
(what is .mprofile and where is it, for example? (Googling isn't helping me find out))
Same thing happened to me
Upgrade to Ubuntu 10.10 broken my Android SDK as well.
Is it possible the Java packages are not installed anymore in Ubuntu?
I tried this...
sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
Updated a lot of stuff but Eclipse Android is still gone...
Does anyone have this figured out yet??????????????????????????????? I NEED TO GET MOVING ON SOME APPS! THIS IS SO FRUSTRATING!
Removal and re-install of ADT plugin does not help
This is the error that appeared in my project the first time I ran eclipse after the 10.10 upgrade from 10.04.
Code:
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project
I attempted to fix the build path (Properties->Java Build Path) and noticed that
com.adroid.ide.eclipse.adt.ANDROID_FRAMEWORK was not checked. I checked it but this made no difference.
Going to try complete uninstall of eclipse...
It's still not working for me
Not .mprofile .profile, it's like .bashrc, a script that is run when you log in, and can set your $PATH variable, or other environment variables.
emacs ~/.profile
or
vi ~/.profile
should enable you to edit it.
Has anyone tried just a fresh reinstall of everything to work on android apps?
Someone asked about java, it's still in /usr/bin/java
SOLUTION
Can't post outside links. So you'll have to google the bug numbers I give.
Ubuntu bug is here: bugs.launchpad # 633198
This points at a debian bug: bugs.debian.org # 587657
Debian bug contains a workaround where you edit the file:
~/.eclipse/org.eclipse.platform_*/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
And you change the concurrent package location (I had too entries, I had to remove them both and insert the line in the debian bug)
and then things magically worked for me again!
Best of luck everyone
Someone else?
Someone else found a way to fix it?
Cuz, everything up till now didnt work for me

How do I push my APK from Eclipse to Emulator?

I reinstalled Windows and now Google Android SDK FINALLY works My question is 1) How do I push the APK into the emulator? I try with a real phone (T-Mobile G2X) and it loads, the log looks like this:
[2011-05-18 02:45:49 - Droid1] Android Launch!
[2011-05-18 02:45:49 - Droid1] adb is running normally.
[2011-05-18 02:45:49 - Droid1] Performing com.androidbook.droid1.DroidActivity activity launch
[2011-05-18 02:45:51 - Droid1] Uploading Droid1.apk onto device '0280400342212257'
[2011-05-18 02:45:51 - Droid1] Installing Droid1.apk...
[2011-05-18 02:45:57 - Droid1] Success!
[2011-05-18 02:45:57 - Droid1] Starting activity com.androidbook.droid1.DroidActivity on device 0280400342212257
[2011-05-18 02:45:57 - Droid1] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.androidbook.droid1/.DroidActivity }
[2011-05-18 02:45:59 - Droid1] Attempting to connect debugger to 'com.androidbook.droid1' on port 8602
Great, so uploading the APP to the phone works
However, with the Emulator, this is what I get:
[2011-05-18 02:49:22 - Droid1] Android Launch!
[2011-05-18 02:49:22 - Droid1] adb is running normally.
[2011-05-18 02:49:22 - Droid1] Performing com.androidbook.droid1.DroidActivity activity launch
[2011-05-18 02:49:26 - Droid1] Launching a new emulator with Virtual Device 'CellNock_2.1'
After launching the Emulator it should push the file, it should say "Uploading to ..."
If anybody has experience with this problem I'll really appreciate your help.
Today is my first day programming for Android and I need the whole environment to work in order to do this app
Open Eclipse and look on the toolbar for an android with a blue box with an arrow underneath it. In the virtual device tab, make a new emulator if you don't have one already. After that is done, start the emulator.
After that, you should be able to hit the run button and it should work fine.

Ipython/Jupyter Notebook on Android

Hello All
I was able to successefuly install Ipython(jupyter) on my nexus(2013) and wanted to share the procedure with all that could be interested.
You could learn and read about Ipython[Jupyter] here
CAUTION:
> To the best of my knowledge this is the first tutorial of it's kind.
> I strongly recomend that you try this on a fresh rom. Use MultiROM for instance
> This was tried on Nexus 7(2013) with android 4.4.4. But I see no reason why it shouldn't work on lolipop 5.0 or on another android tablet. [You could try at your own risk and report your findings]
> Allow minimum 4Gb free space. I used rougthly 2.2 Gb, but i installed more than just ipython
> Hackers Keyboard is VERY HANDY if not NECESSARY
> I apologize for typos and gramar mistakes in advance
> Some of the following steps take time (a long time). Just make sure your tablet is connected to the charge and chose to keep the screan ON while it's on charge
> I am UNLOCKED and ROOTED. I can't tell whether it is required. If it is it would have to be with the prerequired apps. YOU WANNA VERIFY THAT before anything
> MOST IMPORTANTLY, DO THIS AT YOUR OWN RISK. I'm NOT RESPONSIBLE for any INCONVENIANCE whatsoever.
Procedure:
1-: Install GNURoot WheezyX . I am more confortable with debian, tryFedora or Gentoo ... If you know what you are doing.
2- Install GNURoot
3- Open GNURoot
4- Chose wheezyx (or fedora or gentoo ... depending on the distro you like) in the "Select Rootfs to Create " drop-down menu.
5- Click on 'Create New Rootfs' button
6- Chose wheezyx(or fedora or gentoo ... depending on the distro you chose) in the "Select Rootfs to Launch " drop-down menu
7- Check 'Lauch as Facke Root' box. This will give us root privilege
8- Click on 'Lauch Rootfs' button
At this point you shoud have 'Terminal Emulator" open up a window with '[email protected]:/# ' and a prompt ready to take instrucktions
Welcome to linux !!!
Now we need to install "python" and "pip", but before that we need to install 'build-essentials' which will make 'gcc' and all tools required to build a package available on our linux platform:
In the following: if you chose wheezy distro it's the same procedure; if you chose fedora distro replace apt-get with yum; if you chose gentoo you are on your own because I'm not familiar with it
Anyways I assume no responsability anyhow whatsoever.
9 - At the prompt type 'apt-get update' and press Enter
10 - Type 'apt-get upgrade' and press Enter'
11 - Type 'apt-get install build-essential' and press Enter' : This will install "build essential"
12- - Type 'apt-get install python' and press Enter' : This will install "python". I got the version 2.7.3 . You could find the version you installed by typing "python -V" and pressing Enter
13 - Type 'apt-get install python-pip' and press Enter' : This will install "pip", the python package manger
At this point we have python setup in the linux environement. Let's finally install ipython:
14-a Type 'pip install ipython' and press Enter if all you want is the ipython interpreter
15-a Type 'pip install ipython --upgrade' and press Enter to make sure you got the latest version
or
14-b Type 'pip install ipython[all] ' and press Enter if you want ipython and all the goodies like notebook
15-b Type 'pip install ipython [all]--upgrade' and press Enter to make sure you got the latest version
I do scientific work with ipython, so if you are on the same boat as me you could install scientific packages numpy,sympy,pandas,nose,.... with:
"apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose" !!! This is a lot about 1.2Gb !!!
At this point everything is set up. "when the wine is drawn, we now just have to drink it"
16-a Type ' ipython ' and press Enter to run ipython interpreter
or
16-b Type ' ipython notebook' and press Enter to run ipython notwbook. If you get an error message say that ''no web browser could be found" ignore it. look for the server address (looks like http://localhost:8888)
17-b Enter that adress (http://localhost:8888 in my case) in Chrome (I had no problem with chrom so far, but you could try on your favorite web browser) press Enter. Et voila you should be in the ipython notebook tree
I have been here for a couple of years, and never got to share anything.
This is my first thread, and i hope it is the beging of a very long series of contributions
> I will upload screenshots later to better guide noobs (I was one onece)
> PM me if you like to donate. I would appreciate it
> Please support the GNURoot developpers, or ipython[Jupyter] developpers if you can. They are all doing a terrific work. (I'm in no way associated to them, but love and support their work)
> I'm not very good at making videos, but I welcome any initiative.
You now Know how to install ipython, I trus you could be very creative since you now got linux at your finger tip :laugh:
Help to use pandas + matplotlib: no $DISPLAY environment variable
First of all thank you for this pretty cool tutorial
i did it and everything else works after all that huge pip installation!
my problem is that i need to see the result of my codes which sometimes is to show me plots of my data using the library matplotlib.pyplot
when i do that i get the following error:
TclError: no display name and no $DISPLAY environment variable
i found someone with the same problem in another situation (not on android but something like trying to save the plots in a pdf) and the problem was solved doing the import like this:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.show()
By using matplotlib.use('Agg'), python knows to use the non-interactive back-end Agg instead of trying to display to the screen
this means that i don't have anymore the error but the plot won't be shown either
this happens not only when i do python file.py from command line but also when i run the same codes on jupyter notebook
so is there a way to execute file.py so they do what ever pandas want to do in this android environment (especially pop up windows with my plots when I execute the files)?
if there is no way how do i get rid of android to install some better OS on my tablet that can do all this kind of stuff?
thank you but all of this that you have done it's really not that useful if i cant see my plots
let me know!
paolotamag said:
First of all thank you for this pretty cool tutorial
i did it and everything else works after all that huge pip installation!
my problem is that i need to see the result of my codes which sometimes is to show me plots of my data using the library matplotlib.pyplot
when i do that i get the following error:
TclError: no display name and no $DISPLAY environment variable
i found someone with the same problem in another situation (not on android but something like trying to save the plots in a pdf) and the problem was solved doing the import like this:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.show()
By using matplotlib.use('Agg'), python knows to use the non-interactive back-end Agg instead of trying to display to the screen
this means that i don't have anymore the error but the plot won't be shown either
this happens not only when i do python file.py from command line but also when i run the same codes on jupyter notebook
so is there a way to execute file.py so they do what ever pandas want to do in this android environment (especially pop up windows with my plots when I execute the files)?
if there is no way how do i get rid of android to install some better OS on my tablet that can do all this kind of stuff?
thank you but all of this that you have done it's really not that useful if i cant see my plots
let me know!
Click to expand...
Click to collapse
You should know that the linux running GNURoot doesn't have an X-session. You kinda need x11 installed on it to be able to have windows popping up and showing your plots. I remember trying apt-get install x11 without success on "Wheesy". Now, I know there is the "wheesy X" distro of GNURoot, but I don't know whether the X stands for X-session capability; I suggest you try that. (I no longer have my nexus7 to try, but it would be nice to see what happens).
I was able to go around this problem by working on the notebook. I could see my plots fine. I remember firefox beeing the best browser to work on the notebook.
Plots at least on jupyter and transfer files
hey so i found this : (i dont have authorization to post links normally)
stackoverflow .com / questions / 18353203 / using-python-and-matplotlib-on-android
where someone is stating is a big deal to have plotlib working on android
jupyter notebook is not displaying plots not even on firefox, it always give the "TclError: no display name and no $DISPLAY environment variable". It would be awesome if you'd give me a straight solution so i can see plots on jupyter! that would be more than enough to follow lessons in class
the temporary solution i found for now is to remote control my pc at home from the tablet to do all the coding but i cannot work without connection this way
i also found out about this website Wakari but they are saying now there isn't anymore free space for new subscription..
the best solution would be to have plots displaying on jupyter with your help
so the plan for now is to stick to let the pc at home do all the work and remote control it with the samsung remote pc app or to find a good website to log in from the tablet and write codes on browser
ill still use this command line of yours when ever i can thou, when ever there is nothing to display i guess.. but how do I find the folders so i can move to the desktop computer the .py files or the notebook files i create? i was expecting to find the files when i was connecting the tablet with usb wire.. is there anyway to transfer those files?
thank you
izzox said:
You should know that the linux running GNURoot doesn't have an X-session. You kinda need x11 installed on it to be able to have windows popping up and showing your plots. I remember trying apt-get install x11 without success on "Wheesy". Now, I know there is the "wheesy X" distro of GNURoot, but I don't know whether the X stands for X-session capability; I suggest you try that. (I no longer have my nexus7 to try, but it would be nice to see what happens).
I was able to go around this problem by working on the notebook. I could see my plots fine. I remember firefox beeing the best browser to work on the notebook.
Click to expand...
Click to collapse
Use:
%matplotlibe inline
Instead of:
matplotlib.use('Agg')

Categories

Resources