Android Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsMobile ProgrammingAndroid Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 3rd, 2012, 09:26 PM
myandroid myandroid is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 4 myandroid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 56 sec
Reputation Power: 0
Please help me get started!

Hi, I'm a newbie; trying to get started with a simple hello world program to run on the emulator. I see the emulator with "ANDROID", but no "Hello, Android" text on the screen. I'm using Window 7 Home Premium edition, Android SDK for windows, Android 4.0 platform, Java SE 7u2, Eclipse IDE for Java Developers.

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}

Please advise. Thanks.

Reply With Quote
  #2  
Old February 5th, 2012, 10:28 AM
jtalerico jtalerico is offline
Needs a pillow.... :)
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2006
Posts: 681 jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level)jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level)jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level)jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level)jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level)jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level)jtalerico User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 4 h 23 m 21 sec
Reputation Power: 90
__________________
A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools. - Douglas Adams

Reply With Quote
  #3  
Old February 5th, 2012, 01:58 PM
GruntledDroider GruntledDroider is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 3 GruntledDroider User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m
Reputation Power: 0
Quote:
Originally Posted by myandroid
Hi, I'm a newbie; trying to get started with a simple hello world program to run on the emulator. I see the emulator with "ANDROID", but no "Hello, Android" text on the screen. I'm using Window 7 Home Premium edition, Android SDK for windows, Android 4.0 platform, Java SE 7u2, Eclipse IDE for Java Developers.

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}

Please advise. Thanks.


you haven't linked your Text view to the xml reference.

Textview tv = [TextView] findViewBy.Id(R.id.xmlidreference);

in other words, the java can't tell which textview you are trying to change so nothing is happening

Reply With Quote
  #4  
Old February 7th, 2012, 07:41 PM
myandroid myandroid is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2012
Posts: 4 myandroid User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 41 m 56 sec
Reputation Power: 0
I in fact used the hello example from your link. The code snippet from my last post does not work for me, but below works for me:

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}

Thanks for your reply.

Reply With Quote
Reply

Viewing: Dev Shed ForumsMobile ProgrammingAndroid Development > Please help me get started!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap