[android-beginners] How to get direction in my android app
Hi, I'm a beginner in Android and I would like to know if it is possible to use an API for direction getting. Is there a fonction witch permit, as Google Maps for example, to define a path (intermediary points) with a start and a end points ? I would like to do this on android platform and my research shows me that it seems not possible... thank you for your help and please excuse my english ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] HELP! R.layout.main cannot be resolved error
Hey all, I have been fiddling around with Android for the past couple of days, and I was working through the tutorials and sample code. Yesterday, I made an interface with DroidDraw, which generates XML to make the GUI. As far as I can see, everything is in order, but I have an error when it goes to pull the XML from the layout folder. It says that R.layout.main cannot be resolved, and thus all subsequent links to the XML get a similar error. I have been plugging away on this problem for a couple of hours, but cannot get it to work. I checked the forums already, and someone mentioned that the version of DroidDraw may not be compatible with the new SDK, but I checked what was posted, and it seemed to work fine. Below is the JAVA code, and then the XML from Droid Draw.. any help would be appreciated!!! Thanks! package com.android.androidtake2; import android.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; public class androidtake2 extends Activity implements OnClickListener { TextView dollars; TextView euros; RadioButton dtoe; RadioButton etod; Button convert; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); dollars = (TextView)this.findViewById(R.id.dollars); euros = (TextView)this.findViewById(R.id.euros); dtoe = (RadioButton)this.findViewById(R.id.dtoe); dtoe.setChecked(true); etod = (RadioButton)this.findViewById(R.id.etod); convert = (Button)this.findViewById(R.id.convert); convert.setOnClickListener(this); } public void onClick(View v) { if (dtoe.isChecked()) { convertDollarsToEuros(); } if (etod.isChecked()) { convertEurosToDollars(); } } protected void convertDollarsToEuros() { double val = Double.parseDouble(dollars.getText().toString()); euros.setText(Double.toString(val*0.67)); } protected void convertEurosToDollars() { double val = Double.parseDouble(euros.getText().toString()); dollars.setText(Double.toString(val/0.67)); } } DroidDraw XML- ?xml version=1.0 encoding=utf-8? AbsoluteLayout android:id=@+id/widget63 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android; LinearLayout android:id=@+id/widget96 android:layout_width=wrap_content android:layout_height=wrap_content xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_x=91px android:layout_y=0px EditText android:id=@+id/viewdol android:layout_width=100 px android:layout_height=wrap_content android:text=Dollars android:textSize=18sp android:textStyle=bold /EditText TextView android:id=@+id/dollars android:layout_width=100 px android:layout_height=wrap_content android:background=@drawable/lightgray /TextView EditText android:id=@+id/vieweuro android:layout_width=100 px android:layout_height=wrap_content android:text=Euros android:textSize=18sp android:textStyle=bold /EditText TextView android:id=@+id/euros android:layout_width=100 px android:layout_height=wrap_content android:background=@drawable/lightgray /TextView RadioButton android:id=@+id/dtoe android:layout_width=wrap_content android:layout_height=wrap_content android:text=Dollars to Euros /RadioButton RadioButton android:id=@+id/etod android:layout_width=wrap_content android:layout_height=wrap_content android:text=Euros to Dollars /RadioButton /LinearLayout Button android:id=@+id/convert android:layout_width=200px android:layout_height=wrap_content android:background=@drawable/green android:text=Convert android:layout_x=60px android:layout_y=229px /Button /AbsoluteLayout --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: HELP! R.layout.main cannot be resolved error
Hi, It seems that res filename must contain only [a-z0-9_-.]. (It is possibly undocumented issue.) Change your layout filename from DroidDraw.xml to droiddraw.xml or simply main.xml, and hand same name to setContentView(). Best Regards, Tatsu http://www.tatsu.com On Apr 22, 9:31 pm, Kastagire [EMAIL PROTECTED] wrote: Hey all, I have been fiddling around with Android for the past couple of days, and I was working through the tutorials and sample code. Yesterday, I made an interface with DroidDraw, which generates XML to make the GUI. As far as I can see, everything is in order, but I have an error when it goes to pull the XML from the layout folder. It says that R.layout.main cannot be resolved, and thus all subsequent links to the XML get a similar error. I have been plugging away on this problem for a couple of hours, but cannot get it to work. I checked the forums already, and someone mentioned that the version of DroidDraw may not be compatible with the new SDK, but I checked what was posted, and it seemed to work fine. Below is the JAVA code, and then the XML from Droid Draw.. any help would be appreciated!!! Thanks! package com.android.androidtake2; import android.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; public class androidtake2 extends Activity implements OnClickListener { TextView dollars; TextView euros; RadioButton dtoe; RadioButton etod; Button convert; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); dollars = (TextView)this.findViewById(R.id.dollars); euros = (TextView)this.findViewById(R.id.euros); dtoe = (RadioButton)this.findViewById(R.id.dtoe); dtoe.setChecked(true); etod = (RadioButton)this.findViewById(R.id.etod); convert = (Button)this.findViewById(R.id.convert); convert.setOnClickListener(this); } public void onClick(View v) { if (dtoe.isChecked()) { convertDollarsToEuros(); } if (etod.isChecked()) { convertEurosToDollars(); } } protected void convertDollarsToEuros() { double val = Double.parseDouble(dollars.getText().toString()); euros.setText(Double.toString(val*0.67)); } protected void convertEurosToDollars() { double val = Double.parseDouble(euros.getText().toString()); dollars.setText(Double.toString(val/0.67)); } } DroidDraw XML- ?xml version=1.0 encoding=utf-8? AbsoluteLayout android:id=@+id/widget63 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android; LinearLayout android:id=@+id/widget96 android:layout_width=wrap_content android:layout_height=wrap_content xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_x=91px android:layout_y=0px EditText android:id=@+id/viewdol android:layout_width=100 px android:layout_height=wrap_content android:text=Dollars android:textSize=18sp android:textStyle=bold /EditText TextView android:id=@+id/dollars android:layout_width=100 px android:layout_height=wrap_content android:background=@drawable/lightgray /TextView EditText android:id=@+id/vieweuro android:layout_width=100 px android:layout_height=wrap_content android:text=Euros android:textSize=18sp android:textStyle=bold /EditText TextView android:id=@+id/euros android:layout_width=100 px android:layout_height=wrap_content android:background=@drawable/lightgray /TextView RadioButton android:id=@+id/dtoe android:layout_width=wrap_content android:layout_height=wrap_content android:text=Dollars to Euros /RadioButton RadioButton android:id=@+id/etod android:layout_width=wrap_content android:layout_height=wrap_content android:text=Euros to Dollars /RadioButton /LinearLayout Button android:id=@+id/convert android:layout_width=200px android:layout_height=wrap_content android:background=@drawable/green android:text=Convert android:layout_x=60px android:layout_y=229px /Button /AbsoluteLayout --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK!
[android-beginners] GTalkService
hello, does anyone know how GTalkService deals with a subscription request ? i mean the API does not allow you to register any listener to the effect. thank you luka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: HELP! R.layout.main cannot be resolved error
Thank for the info Tatsu... The file I am trying to import is main.xml, and is located in Res-Layout. I just labeled the XML DroidDraw to pretty much say it was from DroidDraw.. I wasn't awake yet when I put that in there I guess, lol. I am not quite following the part about the res filename. Pardon my ignorance, I have only been doing JAVA stuff for a few days, and I am not very well versed in it. Would you be able to be a little more detailed with that explanation? On Apr 22, 9:52 am, Tatsu [EMAIL PROTECTED] wrote: Hi, It seems that res filename must contain only [a-z0-9_-.]. (It is possibly undocumented issue.) Change your layout filename from DroidDraw.xml to droiddraw.xml or simply main.xml, and hand same name to setContentView(). Best Regards, Tatsu http://www.tatsu.com On Apr 22, 9:31 pm, Kastagire [EMAIL PROTECTED] wrote: Hey all, I have been fiddling around with Android for the past couple of days, and I was working through the tutorials and sample code. Yesterday, I made an interface with DroidDraw, which generates XML to make the GUI. As far as I can see, everything is in order, but I have an error when it goes to pull the XML from the layout folder. It says that R.layout.main cannot be resolved, and thus all subsequent links to the XML get a similar error. I have been plugging away on this problem for a couple of hours, but cannot get it to work. I checked the forums already, and someone mentioned that the version of DroidDraw may not be compatible with the new SDK, but I checked what was posted, and it seemed to work fine. Below is the JAVA code, and then the XML from Droid Draw.. any help would be appreciated!!! Thanks! package com.android.androidtake2; import android.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; public class androidtake2 extends Activity implements OnClickListener { TextView dollars; TextView euros; RadioButton dtoe; RadioButton etod; Button convert; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); dollars = (TextView)this.findViewById(R.id.dollars); euros = (TextView)this.findViewById(R.id.euros); dtoe = (RadioButton)this.findViewById(R.id.dtoe); dtoe.setChecked(true); etod = (RadioButton)this.findViewById(R.id.etod); convert = (Button)this.findViewById(R.id.convert); convert.setOnClickListener(this); } public void onClick(View v) { if (dtoe.isChecked()) { convertDollarsToEuros(); } if (etod.isChecked()) { convertEurosToDollars(); } } protected void convertDollarsToEuros() { double val = Double.parseDouble(dollars.getText().toString()); euros.setText(Double.toString(val*0.67)); } protected void convertEurosToDollars() { double val = Double.parseDouble(euros.getText().toString()); dollars.setText(Double.toString(val/0.67)); } } DroidDraw XML- ?xml version=1.0 encoding=utf-8? AbsoluteLayout android:id=@+id/widget63 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android; LinearLayout android:id=@+id/widget96 android:layout_width=wrap_content android:layout_height=wrap_content xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_x=91px android:layout_y=0px EditText android:id=@+id/viewdol android:layout_width=100 px android:layout_height=wrap_content android:text=Dollars android:textSize=18sp android:textStyle=bold /EditText TextView android:id=@+id/dollars android:layout_width=100 px android:layout_height=wrap_content android:background=@drawable/lightgray /TextView EditText android:id=@+id/vieweuro android:layout_width=100 px android:layout_height=wrap_content android:text=Euros android:textSize=18sp android:textStyle=bold /EditText TextView android:id=@+id/euros android:layout_width=100 px android:layout_height=wrap_content android:background=@drawable/lightgray /TextView RadioButton android:id=@+id/dtoe android:layout_width=wrap_content android:layout_height=wrap_content android:text=Dollars to Euros /RadioButton RadioButton android:id=@+id/etod android:layout_width=wrap_content android:layout_height=wrap_content android:text=Euros to Dollars
[android-beginners] Re: HELP! R.layout.main cannot be resolved error
Well, the resource stuff isn't a Java thing, it's an Android thing. Basically if you put a layout xml file in res/layout, you reference it by filename when you call setContentView. For instance, if you have res/layout/my_fancy_layout.xml, you make a call to setContentView(R.layout.my_fancy_layout). But, it sounds like you have a main.xml in that directory and using it correctly with setContentView. The layout xml looks valid for the m5 sdk. Are you using m5 or m3? Also, if you are using eclipse, it should tell you if theres a problem in the xml file itself when you open the file. That might give some insight. On Apr 22, 10:14 am, Kastagire [EMAIL PROTECTED] wrote: Thank for the info Tatsu... The file I am trying to import is main.xml, and is located in Res-Layout. I just labeled the XML DroidDraw to pretty much say it was from DroidDraw.. I wasn't awake yet when I put that in there I guess, lol. I am not quite following the part about the res filename. Pardon my ignorance, I have only been doing JAVA stuff for a few days, and I am not very well versed in it. Would you be able to be a little more detailed with that explanation? On Apr 22, 9:52 am, Tatsu [EMAIL PROTECTED] wrote: Hi, It seems that res filename must contain only [a-z0-9_-.]. (It is possibly undocumented issue.) Change your layout filename from DroidDraw.xml to droiddraw.xml or simply main.xml, and hand same name to setContentView(). Best Regards, Tatsu http://www.tatsu.com On Apr 22, 9:31 pm, Kastagire [EMAIL PROTECTED] wrote: Hey all, I have been fiddling around with Android for the past couple of days, and I was working through the tutorials and sample code. Yesterday, I made an interface with DroidDraw, which generates XML to make the GUI. As far as I can see, everything is in order, but I have an error when it goes to pull the XML from the layout folder. It says that R.layout.main cannot be resolved, and thus all subsequent links to the XML get a similar error. I have been plugging away on this problem for a couple of hours, but cannot get it to work. I checked the forums already, and someone mentioned that the version of DroidDraw may not be compatible with the new SDK, but I checked what was posted, and it seemed to work fine. Below is the JAVA code, and then the XML from Droid Draw.. any help would be appreciated!!! Thanks! package com.android.androidtake2; import android.R; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.RadioButton; import android.widget.TextView; public class androidtake2 extends Activity implements OnClickListener { TextView dollars; TextView euros; RadioButton dtoe; RadioButton etod; Button convert; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); dollars = (TextView)this.findViewById(R.id.dollars); euros = (TextView)this.findViewById(R.id.euros); dtoe = (RadioButton)this.findViewById(R.id.dtoe); dtoe.setChecked(true); etod = (RadioButton)this.findViewById(R.id.etod); convert = (Button)this.findViewById(R.id.convert); convert.setOnClickListener(this); } public void onClick(View v) { if (dtoe.isChecked()) { convertDollarsToEuros(); } if (etod.isChecked()) { convertEurosToDollars(); } } protected void convertDollarsToEuros() { double val = Double.parseDouble(dollars.getText().toString()); euros.setText(Double.toString(val*0.67)); } protected void convertEurosToDollars() { double val = Double.parseDouble(euros.getText().toString()); dollars.setText(Double.toString(val/0.67)); } } DroidDraw XML- ?xml version=1.0 encoding=utf-8? AbsoluteLayout android:id=@+id/widget63 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android; LinearLayout android:id=@+id/widget96 android:layout_width=wrap_content android:layout_height=wrap_content xmlns:android=http://schemas.android.com/apk/res/android; android:orientation=vertical android:layout_x=91px android:layout_y=0px EditText android:id=@+id/viewdol android:layout_width=100 px android:layout_height=wrap_content android:text=Dollars android:textSize=18sp android:textStyle=bold /EditText TextView
[android-beginners] EditText getText() to string for notification
Hi, I have my application set to grab the text from an EditText field, but for some reason even if I convert it toString, the returned string always comes back blank. Here is my code: Button button; EditText text; button = (Button) findViewById(R.id.btnOK); text = (EditText) findViewById(R.id.txtCustomerName); final String message = text.getText().toString(); button.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Toast.makeText(HelloWorld.this, message, Toast.LENGTH_SHORT).show(); } }); Sorry for the bad code organization, but copy and paste didn't really work out the way I imagined, Haha. Any help would be great. Also, I tried searching, but for some reason I just can't find a solution. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText getText() to string for notification
Because message is whatever text is in the EditText whenever this bit of code runs. I assume this is ran in onCreate? Probably this is blank unless you gave it a default value. What you might try is to remove the message variable and then call text.getText().toString() in the Toast.makeText method. On Apr 22, 2:28 pm, Kyle [EMAIL PROTECTED] wrote: Hi, I have my application set to grab the text from an EditText field, but for some reason even if I convert it toString, the returned string always comes back blank. Here is my code: Button button; EditText text; button = (Button) findViewById(R.id.btnOK); text = (EditText) findViewById(R.id.txtCustomerName); final String message = text.getText().toString(); button.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Toast.makeText(HelloWorld.this, message, Toast.LENGTH_SHORT).show(); } }); Sorry for the bad code organization, but copy and paste didn't really work out the way I imagined, Haha. Any help would be great. Also, I tried searching, but for some reason I just can't find a solution. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: EditText getText() to string for notification
Oh boy, so simple, why didn't I think of it, trying to get something that doesn't exist... Thanks a ton Dan, I'll try to stay within reality next time, haha. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: About Hardware Requirements
XP with 2G of memory is a good starting place. On Apr 22, 1:17 pm, pramod [EMAIL PROTECTED] wrote: Hello, I want to know the hardware requirements to run Android application. What is the requirements to run Android application on computer as well on physical emulator device? Thanks, Pramod --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---