problems getting started

by leeuwerik » Fri, 04 Sep 2009 01:52:58 GMT


Sponsored Links
 I'm brand new to Android (although not to Eclipse and Java).
Yesterday I installed ADT within Eclipse (always latest versions) both
on Windows and XP.
Then I try creating HelloWorld by following the tutorial.

When creatin the android project I get an error on the line
setContentView(R.layout.main) ==> R unknown.

I tried ctr-shift-O ==> import android.R is added but the error
remains.

Undaunted I follow the tuturial and edit to create a TextView instead
==> application runs, i.e. I see a mobile terminal image with
'ANDROID' written in the centre. On XP it's strange: after a seemingly
long time-out the text font changes and an icon (android) is added
after the text.

Next I try editing the resource .xml files as suggested in the
tutorial in order to change the text. This also implies reintroducing
the line with setContentView(R.layout.main) in lieu of the TextView.
This time no error reported !!!!

When inspecting main.xml, the new layout and text look OK. Yet when
running the application I keep getting the same mobile picture, i.e.
without the new text. It looks like the emulation doesn't work
properly.
I rebuilt the application from scratch and did another tutorial, with
the same negative result.

I must say that I'm lost.
Can anyone help please ????

--~--~---------~--~----~------------~-------~--~----~



problems getting started

by Justin Anderson » Fri, 04 Sep 2009 04:37:46 GMT


 R is a class that is generated at compile-time.

In particular, to get R.layout.main you need to create a file names main.xml
in your res/layout folder and create the layout in xml format as described
in the Dev Guide docs.

I've never used the emulator (I push my apps directly to my phone for
debugging) so I can't help with that...

Let me know if this helps,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------






--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


problems getting started

by Roman ( T-Mobile USA) » Fri, 04 Sep 2009 05:03:54 GMT


 When you create your first Android application you normally have not
to do anything besides creating an Android project. The Eclipse ADT is
going to create all the needed resources for you.

Check the following


 - Your Eclipse:
for example
Version: 3.4.1
Build id: M20080911-1700

 - the Problems-tab in Eclipse editor
 - make sure that ADT is correctly installed
--
Roman Baumgaertner
Sr. SW Engineer-OSDC
T  Mobile stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



--~--~---------~--~----~------------~-------~--~----~



problems getting started

by John P. » Fri, 04 Sep 2009 06:13:33 GMT


 Regarding the cases when the R class does not get generated/updated in
time, try the following (in no particular order):

- Manually delete the R.java class, so the next time it will generate
a completely new one.
- Right click on the project -> Android Tools -> Fix Project
Properties
- Clean the project under Project -> Clean
- Restart Eclipse

Regarding the case when updating the text in the layout did not
reflect in the emulator, are you sure the latest project was deployed
to the emulator?  Can you confirm that the APK is built and pushed to
the emulator by looking at the console?  Sometimes, the ADB has issues
and it disconnects with the emulator.  If this was the case, your
emulator was still running the previous version.



--~--~---------~--~----~------------~-------~--~----~



problems getting started

by leeuwerik » Fri, 04 Sep 2009 17:46:48 GMT


 Thanks for your reply.
main.xml is properly created, so that is not the problem
See also my answer in the reply to John P.






--~--~---------~--~----~------------~-------~--~----~



problems getting started

by leeuwerik » Fri, 04 Sep 2009 17:47:22 GMT


 Thank you for your reply.
I did not delete class R.java since I could not find it.
But I did the right click fix as you suggested + clean + rebuild all
(no restart Eclipse) ==> problem went away

Re. the emulator. I realized that it is EXTREMELY slow even on my new
double Pentium PC.
It takes nearly 2 minutes to launch and display the application in the
emulated terminal.
Not very useful for development !!!!!!
The better way to view the screen is by displaying main.xml.






--~--~---------~--~----~------------~-------~--~----~



problems getting started

by John P. » Fri, 04 Sep 2009 21:17:15 GMT


 ust FYI, you don't need to close and restart the emulator every time
you want to deploy something. It also takes me about 2 minutes to
boot up the emulator the first time, but about 5 seconds to deploy
afterwards. As usual, you can confirm it was deployed successfully by
checking the console.

On Sep 4, 5:43am, leeuwerik <l...@qilium.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



problems getting started

by QTB QTB » Sat, 05 Sep 2009 02:25:09 GMT


 Try removing import android.R, then rebuild.




--~--~---------~--~----~------------~-------~--~----~



problems getting started

by Tiago Becker » Sat, 05 Sep 2009 02:30:08 GMT


 On my pc, it  took really  a looong time to move from the "android"
screen to the home screen on the emulator, the first time i tried (i
did kill the process 3 or 4 times before letting it run for like 10
mins)

My guess is that your program is ok, its just the emulator that is
slow as hell....

On Thu, Sep 3, 2009 at 6:03 PM, Roman ( T-Mobile




--~--~---------~--~----~------------~-------~--~----~



problems getting started

by tinyang » Sat, 05 Sep 2009 03:23:21 GMT


 he emulator can be very slow depending on the specs of the machine it's
running on. Not bad on my dev pc, it opens and runs my app in less than a
minute.

-----Original Message-----
From: android-beginners@googlegroups.com
[mailto:android-beginn...@googlegroups.com] On Behalf Of Tiago Becker
Sent: Thursday, September 03, 2009 4:09 PM
To: android-beginners@googlegroups.com
Subject: [android-beginners] Re: problems getting started


On my pc, it took really a looong time to move from the "android"
screen to the home screen on the emulator, the first time i tried (i did
kill the process 3 or 4 times before letting it run for like 10
mins)

My guess is that your program is ok, its just the emulator that is slow as
hell....

On Thu, Sep 3, 2009 at 6:03 PM, Roman ( T-Mobile
USA)<roman.baumgaert...@t-mobile.com> wrote:


No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 9/3/2009
6:05 PM


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. when I start to compile the Launcher module, lots of erros occurred.

Launcher cannot compile against the SDK, sorry.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~

2. How can i implement search functionality in GoogleMaps while using SDK 1.5.

Hi all,

As subject states i need to implement Search on Google maps.
The Api "com.google.googlenav.Search" is not supported.
It seems that it is removed from SDK 1.5.
Can any body please provide me the reference regarding this.

any type of help/info would be greatly appriciated.

thanks in advance,
Freshman
--~--~---------~--~----~------------~-------~--~----~

3. my app crashes when switching to landscape mode

4. Q re Android Programming Tutorials a.M Murphy

5. when I start to compile the Launcher module, lots of erros occurred.

6. How can i implement search function of GoogleMaps on SDK 1.5.

7. why i cant connect to the internet,i have added the permission.