android wont re run

package com.test;

import android.os.Bundle;
import android.widget.TextView;


I am getting problems again rerunning my android app.
I am using android 2.2 .

I cant run again my app without building workspace hanging around 27% complete.
I set run-config to automatic and checked with  android platform.

public class And2_2btestActivity extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        TextView tv = new TextView(this);
        tv.setText("Hello, Android 6");
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Didn't you write that it works in the previous question ?
So it worked and then stopped working?
jagguyAuthor Commented:
unfortunately yes this happened.
so you installed two platforms - 4 0 3 and one older platform  ?
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

jagguyAuthor Commented:
android 4.03 works fine and i can re run this but 2.2 isnt
I instaled only one, so I'm not sure I understadn - if you installed two, how does it know which libraries to use? Can you specify it when you create project?
jagguyAuthor Commented:
in the automatic option to re run a program you select one.

i thought i need to create a AVD for each platform.

if i want to code for android 2.2 then i need AVD for 2.2
Yes, indeed, I see you can specify the target when you create project, so you have tow Android projects - one for 4.0.3 and one for 2.2.3 ?
>if i want to code for android 2.2 then i need AVD for 2.2
taht is true, but I think it may be not enough

when you create project it also asks for the target - so you need to commit to the target from the beginning
jagguyAuthor Commented:
if I wan to code for android 2.2 then do I need a AVD  for just 2.2

Can I code for android 2.2 and use a AVD 4.03 .

I created a 2.2 project and it wont re run without closing eclipse and running the program once  only
Can I code for android 2.2 and use a AVD 4.03 .
Taht may be possible, but it is probably safer not to do it

In the opposite way it would probably be incorrect.
jagguyAuthor Commented:
to code for android 2.2 what do I do because my project is unstable.

I have a AVD 2.2 so why isnt this stable like 4.03?
with 4.0.3 does it work for you in both cases - when you close emulator - it cretaes emulator then and hwen you don't close it - it then just replaces the application ?
(it works so for me).

And in case of 2.2 - in both these cases it just hangs second time ?
jagguyAuthor Commented:
yes 4.03 works fine as you mentioned.

2.2 only runs once , the emulator works and then I need to reboot eclipse to run the 2.2 app again
SanthanaTechnical LeadCommented:
Hi  jagguy,

1) Some times if you run the application from newer version to older version it will not work. It will simply hangs . I guess adb is creating problem while doing so...

What i used to do is  just kill the old adb through "adb -e kill-server" then start the server again through "adb -e start-server"..

2)  While creating a android project itself it will ask the "Build Target". Here  while creating project in platforms - 4 0 3  you have selected  Build Target as "Android 4.0".
This property will be seted in your application manifest.xml as <uses-sdk android:minSdkVersion="11">
So if you try to run the same project by using the lower version like android 2.2 , i guess it will not allow to install the application. So here this property need to be changed....
jagguyAuthor Commented:
I have 2 projects not 1. Each project has a different android version as I am testing it.

4.03 android app works

2.2 android app  works once only then i need to reboot eclipse and run it again.If I run this project again without rebooting eclipse  the app hangs .

so what do I do in this case? is the 2.2 corrupted o do i need to set another setting.

how do i kill the adb in windows7
I think you installed Eclipse/Android on two computers;
is it the same with 2.2 on both ?

One thing to consider  - don't worry about 2.2; learn how to write programs for 4.0.3.
By the time you write something real,  4.0.3 will already be not so new :)
jagguyAuthor Commented:
It looks like those folks in the link imply that in case you do not close emulator - then it should run second time OK; in your case however that was not the case
SanthanaTechnical LeadCommented:
Hi  jagguy,

Try this in command prompt ....       adb -e kill-server. Then run your project again....It will start the fresh abd.....
SanthanaTechnical LeadCommented:
Hi  jagguy,

Run this command in command prompt.......
adb -e kill-server

And start the fresh adb by adb -e start-server....
I guess  this is creating  problem....
jagguyAuthor Commented:
It works when I follow advice in that link...see I wasnt crazy after all with my 27% program loaded.

Launch the AVD manager and click the AVD that you've already created before, then click start button. Then once the AVD

when this is loaded with background and unlock etc then run the program from eclipse over and over again. android 2.2 needs this.

Also, can i kill the process in task manager in win7 or do I need command prompt to do this and from what directory?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SanthanaTechnical LeadCommented:
Hi  jagguy,

Also, can i kill the process in task manager in win7 or do I need command prompt to do this and from what directory?

Yes ..You can kill...through task manager...

2) From Your SDK folder.... /android-sdk/platform-tools ..( Here you can find the adb)
SanthanaTechnical LeadCommented:
Hi  jagguy,

Have you tried my suggestions...?????
jagguyAuthor Commented:
I found the solution
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.