Hello everybody,
I am trying to run my first program in android but I got error.
I havae following code in my .java file
and following in my main.xml file
But when I tried to run the program I got 3 error as "R can not be resolved" at shown above.
I had to find out solution for this but my problem is not solved. Some forum says make another program and run it. I tried it for 3 times but every time I got same error as "R can not be resolved". Please help me.
Thank you
Life is easy because we write the source code.....
Ksh Aggarwal
Greenhorn
Joined: Sep 16, 2009
Posts: 28
posted
0
This error is because eclipse cannot find 'R.java' file.
You have to import the 'R.java' file manually since eclipse has not done so itself.
Hello Ksh,
I don't know how but erros are now solved but now on emulator following error is generated as
"The application NewApp(process com.micro) has stopped unexpectedly. Please try again".
and "Force clode" button is displayed.
Thanks
Ksh Aggarwal
Greenhorn
Joined: Sep 16, 2009
Posts: 28
posted
0
Check the logcat of the emulator. your application has encountered some error. you can find the exception stack trace in the logcat
You have to veiw the logcat in DDMS. its a view option in eclipse. select the emulator from the left and see the logcat window for the logs created by emulator
sorry for silly questions, but will you please tell me how to view logcat in DDMS. I can't find view option in eclipse.
Thanks
Ksh Aggarwal
Greenhorn
Joined: Sep 16, 2009
Posts: 28
posted
0
go to Window>Open perspective>others. Select DDMS
There you have devices window on left and LogCat window at bottom. Select the emulator from device window nd you can then veiw the logs in LogCat window. This is where all your logs (error trace and println commands) will be shown.
Use it for some time. U'll get used to it
for your help, now I am able to open Logcat but I didin't get any clue.
Ksh Aggarwal
Greenhorn
Joined: Sep 16, 2009
Posts: 28
posted
0
Pramod P Deore wrote:
for your help, now I am able to open Logcat but I didin't get any clue.
Now run the application again and see the logcat as the application progresses. an error in application will create a error trace in red color in logcat.