[android-developers] Please help me
Hello, I want to capture the phone number of any android device. am using this code TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); sim = mTelephonyMgr.getLine1Number(); in emulator it returns a value. But when i check in real device it returns nothing. So please give me the perfect code by which i can capture the phone number of a real device. Thanks, Suman Ganguly. (Android Developer) -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Please help me !!
Hi Can any one tell me is group messaging is possible in android or not. If yes then please tell me something like how can i implement this? Thanks, Suman -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: Please help me !!
On Tue, Dec 8, 2009 at 12:29 AM, Phil V trainstro...@gmail.com wrote: Do you mean like an android exclusive chatroom? On Dec 7, 1:44 pm, IPEG Student ipeg.stud...@gmail.com wrote: Hi Can any one tell me is group messaging is possible in android or not. If yes then please tell me something like how can i implement this? Thanks, Suman -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en Thanks for reply first. But i want to ask you that whether group sms activity like sms sending to multiple contacts at a time is possible on android or not. Am not asking for chatroom. Thanks, Suman -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] connecting server problems
Hello How can i send information to external server database by android coding ? Thanks and Regs Suman -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Interesting and urgent
Hello I post a code by which i can call any one from contact list . protected void onListItemClick(ListView l, View v, int position, long id){ super.onListItemClick(l, v, position, id); Intent i = new Intent(Intent.ACTION_CALL); Cursor c = (Cursor) myAdapter.getItem(position); long phoneID = c.getLong(c.getColumnIndex(People.PRIMARY_PHONE_ID)); i.setData(ContentUris.withAppendedId( android.provider.Contacts.Phones.CONTENT_URI, phoneID)); this.startActivity(i); } I have added uses-permission android:name=android.permission.READ_CONTACTS / uses-permission android:name=android.permission.WRITE_CONTACTS / in mainfest. *Now my question is how can i delete and edit a contact? What changes will be needed here? Please response me as soon as possible? Thanks in advance. Suman Ganguly. * -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Very Urgent
Hello btn.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String _lat=lat.getText().toString(); String _lon=lon.getText().toString(); Uri uri=Uri.parse(geo:+_lat+,+_lon); //Uri smsuri = Uri.parse(content://sms/inbox/12); startActivity(new Intent(Intent.ACTION_VIEW, uri)); } }); This code is not running in android-sdk1.5 but in 0.9 . Please give me appropriate code . I want to display the google map. Thanks in advance. Suman Ganguly. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Very Urgent
Hello The MapActivity class is not resolving. The code is :: import com.google.android.maps.MapActivity; import com.google.android.maps.MapView; import android.os.Bundle; public class testandroid extends MapActivity { /** Called when the activity is first created. */ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } protected boolean isRouteDisplayed() { return false; } } I cant override MapActivity class. This class is not resolved here. in xml i have added RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android; android:layout_width=fill_parent android:layout_height=fill_parent com.google.android.maps.MapView android:id=@+id/mapView android:layout_width=fill_parent android:layout_height=fill_parent android:enabled=true android:clickable=true android:apiKey=0AmbFGlyCruwUkWjivbCgh-Gn9sxpeSPOJv_Aaw / /RelativeLayout Please help me as soon as possible. Thanks Suman Ganguly -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: Very urgent
On Wed, Oct 21, 2009 at 7:45 AM, kevin.hooke kevin.ho...@gmail.com wrote: If you tell us a bit more about what you're trying to do then someone might be able to help you? On Oct 20, 2:50 pm, IPEG Student ipeg.stud...@gmail.com wrote: Hello can any body tell me how can i delete this string. I have used this coding. temp = temp1.replace(temp1.substring(temp1.indexOf(Address2= ),temp1.indexOf(Address2=) + temp1.indexOf(; )), ); //*temp* = temp1. //*temp* = temp1.replace(temp1.substring(temp1.indexOf(Address2=),temp1.indexOf(Add ress2=) + temp1.indexOf( )), Hello); Log.*e*(tempzhaid: , temp); Thanks in advance. Thanks for reply. i want to delete the specific string starting from Address2= and ending by ; from a sentence. And display the string in log. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Very urgent
Hello can any body tell me how can i delete this string. I have used this coding. temp = temp1.replace(temp1.substring(temp1.indexOf(Address2= ),temp1.indexOf(Address2=) + temp1.indexOf(; )), ); //*temp* = temp1. //*temp* = temp1.replace(temp1.substring(temp1.indexOf(Address2=),temp1.indexOf(Address2=) + temp1.indexOf( )), Hello); Log.*e*(tempzhaid: , temp); Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Go to the home screen.
On 2/27/09, Dianne Hackborn hack...@android.com wrote: And for heaven's sake don't call System.exit()! On Thu, Feb 26, 2009 at 10:50 AM, Marco Nelissen marc...@android.comwrote: On Thu, Feb 26, 2009 at 5:26 AM, Zack zhalbre...@gmail.com wrote: Hi, I'm trying to do something similar. I have a few activities in my app. When the app starts it goes from EULA - Loading Screen - Main Activity If I get to the Main Activity and hit the back button it will go back to the Loading Screen (which I understand) but now I'm trapping the onKeyDown for the back button in my Main Activity and would like to get to the home screen through startActivity() System.exit(1) as suggested below seems to just restart my Main Activity. Any suggestions? Thanks! You can just have your loading screen and EULA activities call finish() on themselves when they are done. That way your 'main' activity becomes the first activity in the chain, and exiting it will exit your app. -- Dianne Hackborn Android framework engineer hack...@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. Try this coding.. Intent i = *new* Intent(); i.setAction(android.intent.action.MAIN); i.addCategory(android.intent.category.HOME); startActivity(i); I think it can solve your problem. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How can i access one activity from another in the same package?
Hi Android Developers.. Thanks for the greate replies. Now my question is I have 5 activities in my project. How can i check the condition of 2nd activity from 4th activity? Based upon this condition i want to do something. If anybody know this please tell me. Am waiting for the response. Thanks in advance. Suman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Access one activity from another one in the same package.
Hello Thanks for the reply. I want to say I have 5 activities. In activity 2 i have made some change and save the change by getPreferences(); method ok. Now i want to check this settings from activity4. Cn i do this? If yes, then please tell me how? Am waiting for the correct answer. Thanks in advance. Suman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Go to the home screen.
Hi All Android Developers... Thanks for the replaies. I want to go to the home page of android from my activity. Can anybody tell me how can i do this? I have tried a lot. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Go to the home screen.
Hello Thanks for the reply. But my question is i have a exit button. I want to go to the home screen by clicking the button. I know the onClick() method. Please tell me the method by which i can go to the home page of android. btn4=(Button)findViewById(R.id.bt4); btn4.setOnClickListener(new ImageButton.OnClickListener() { public void onClick(View v) { } }); i dont want finish() method. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Go to the home screen
Hello Thanks. But my problem is not solved. actually i have many activities. So when i go to the 2nd activity and return to the first one then System.exit(1); is working just as a back button. But i want to go the home screen. Please tell me what can i do? Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Interesting Question
Hello... Can any one tel me what is the method behind Home button? Am waiting for the correct answer. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Difficult Button
Hi all Thanks for the greate replies. I have a porgram by which i draw a rectengle. The code is written below. // public class Hellobye2 extends Activity { SampleView mView; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mView = new SampleView(this); setContentView(mView); } } // Now my problem is I want to insert a button in this page. But i cant use setContentView(R.layout.main); How can i crerate a button which is defiend on main.xml. Please give me the appropiate code. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Inserting button in a difficult position
Hi all Thanks for the greate replies. I have a porgram by which i draw a rectengle. The code is written below. // public class Hellobye2 extends Activity { SampleView mView; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mView = new SampleView(this); setContentView(mView); } } // Now my problem is I want to insert a button in this page. But i cant use setContentView(R.layout.main); How can i crerate a button which is defiend on main.xml. Please give me the appropiate code. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Button Problem
Hello Thanks for the reply. But i am facing the same problem. How can i put the button in this page? private static class SampleView extends View { private Canvas mCanvas; private final Paint mPaint; public SampleView(Context context) { super(context); } protected void onDraw(Canvas canvas) { } This is the coding of drawing something. But can you tell me how can i put the button in this page? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Tough Problem
Hi all Thanks for the greate replies. I have a porgram by which i draw a rectengle. The code is written below. // public class Hellobye2 extends Activity { SampleView mView; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mView = new SampleView(this); setContentView(mView); } } // Now my problem is I want to insert a button in this page. But i cant use setContentView(R.layout.main); How can i crerate a button which is defiend on main.xml. Please give me the appropiate code. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Interesting problem
Hi developers. Thanks for the replies. I have a problem from last few days. I want to delete sms from my inbox. I have used this code for deletion. Uri uri = Uri.parse(content://sms/inbox); Cursor c1= getContentResolver().query(uri, null, null,null,null); int thread_id = c1.getInt(1); getContentResolver().delete(Uri.parse(content://sms/ conversations/ + thread_id),null,null); // But it dose not work . Please help me if any thing wrong and give me the right code. Thanks in advance . Suman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Just one line program that will make you crazy.
Hi, I am stuck with a small problem for several days, I am unable to delete any SMS. The error is in just 1 line. Look at the code below and the associated XML . If I run the code, it shows the list of all SMS in my inbox. There is an SMS whose _ID is equal to 7 . If I enable the line getContentResolver().delete(.. which I have commented, my program crashes in the emulator. What is going wrong? Please help me out. # # # package org.anddev.android.hello; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class HelloAndroid extends ListActivity { private ListAdapter mAdapter; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Uri uri = Uri.parse(content://sms/inbox/); String[] columns = new String[]{_ID}; int[] names = new int[]{R.id.row_entry}; Cursor c1= getContentResolver().query(uri, null, null,null,null); // getContentResolver().delete( uri , _ID = 7 , null); mAdapter = new SimpleCursorAdapter(this, R.layout.main, c1, columns, names); this.setListAdapter(mAdapter); } } # # # ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=org.anddev.android.hello uses-permission android:name=android.permission.READ_SMS / uses-permission android:name=android.permission.WRITE_SMS / uses-permission android:name=android.permission.RECEIVE_SMS / application android:icon=@drawable/icon activity android:name=.HelloAndroid android:label=@string/ app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity activity android:name=.Hello android:label=@string/ app_name /activity activity android:name=.Hello1 android:label=@string/ app_name /activity /application /manifest # # # --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] 1 line to correct! Only for the best Programmers
Hi Developers, I am stuck with a small problem for several days, I am unable to delete any SMS. Look at the code below and the associated XML . If I run the code, it shows the list of all SMS in my inbox. There is an SMS whose _ID is equal to 7 . If I enable the line getContentResolver().delete(.. which I have commented, my program crashes in the emulator. What is going wrong? Please help me out. # # # package org.anddev.android.hello; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class HelloAndroid extends ListActivity { private ListAdapter mAdapter; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Uri uri = Uri.parse(content://sms/inbox/); String[] columns = new String[]{_ID}; int[] names = new int[]{R.id.row_entry}; Cursor c1= getContentResolver().query(uri, null, null,null,null); // getContentResolver().delete( uri , _ID = 7 , null); mAdapter = new SimpleCursorAdapter(this, R.layout.main, c1, columns, names); this.setListAdapter(mAdapter); } } # # # ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=org.anddev.android.hello uses-permission android:name=android.permission.READ_SMS / uses-permission android:name=android.permission.WRITE_SMS / uses-permission android:name=android.permission.RECEIVE_SMS / application android:icon=@drawable/icon activity android:name=.HelloAndroid android:label=@string/ app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity activity android:name=.Hello android:label=@string/ app_name /activity activity android:name=.Hello1 android:label=@string/ app_name /activity /application /manifest # # # --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Android Challenge!! Can you correct this 1 line ?????
Please help Me!!! I am stuck with a small problem for several days, I am unable to delete any SMS. The error is in just 1 line. Look at the code below and the associated XML . If I run the code, it shows the list of all SMS in my inbox. There is an SMS whose _ID is equal to 7 . If I enable the line getContentResolver().delete(.. which I have commented, my program crashes in the emulator. What is going wrong? Please help me out. # # # package org.anddev.android.hello; import android.app.ListActivity; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class HelloAndroid extends ListActivity { private ListAdapter mAdapter; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Uri uri = Uri.parse(content://sms/inbox/); String[] columns = new String[]{_ID}; int[] names = new int[]{R.id.row_entry}; Cursor c1= getContentResolver().query(uri, null, null,null,null); // getContentResolver().delete( uri , _ID = 7 , null); mAdapter = new SimpleCursorAdapter(this, R.layout.main, c1, columns, names); this.setListAdapter(mAdapter); } } # # # ?xml version=1.0 encoding=utf-8? manifest xmlns:android=http://schemas.android.com/apk/res/android; package=org.anddev.android.hello uses-permission android:name=android.permission.READ_SMS / uses-permission android:name=android.permission.WRITE_SMS / uses-permission android:name=android.permission.RECEIVE_SMS / application android:icon=@drawable/icon activity android:name=.HelloAndroid android:label=@string/ app_name intent-filter action android:name=android.intent.action.MAIN / category android:name=android.intent.category.LAUNCHER / /intent-filter /activity activity android:name=.Hello android:label=@string/ app_name /activity activity android:name=.Hello1 android:label=@string/ app_name /activity /application /manifest # # # --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Help!!!! How do I delete sms from inbox?
I need to know the code for deleting an SMS from the inbox. Please help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] unable to delete sms from inbox
Hi, I am trying to delete sms from inbox getContentResolver().delete(Uri.parse(content://sms/conversations/ 9), null, null); the above statement does not work. gives error. Please help me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] How can i close my project?
Hi developers I have a problem. I have a project which has 5 activities. All the activities are connected through intent. I have a exit button to exit the whole project . I have used finish() function but it just close the current activity. It works like back. Please give me the appropiate funtion replace of finish() by which i can exit my project. Suman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Strange and interesting problem (For Really ANDROID Lovers)
Hi developers... First of all thanks for the greate replies. Now i have a very strange problem. Now i can access all the sms those have hello in their body. I want to send the content of each sms to another program. But the problem is i can able to send only the the content of last sms.I mean all the sms send the same thing the content of last sms. I have tried a lot to solve the problem. But i cant send the each content of each sms . I give u the coding. import android.app.Activity; import android.app.ListActivity; import android.content.ContentUris; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People; import android.provider.Telephony.Carriers; import android.widget.LinearLayout; import android.telephony.gsm.SmsMessage; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public class tele extends Activity { TextView ms1; TextView ms2; String MyMsg = ; // Button ms1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); // ms1=(Button)findViewById(R.id.ms1); LinearLayout layout = (LinearLayout) findViewById(R.id.ms1); LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT ); Uri uri = Uri.parse(content://sms/inbox); Cursor c= getContentResolver().query(uri, null, body like '%hello%',null,null); // Cursor c = getContentResolver().query(Carriers.CONTENT_URI, null, null, null, null); startManagingCursor(c); if(c.getCount() !=0) { String[] str = new String[c.getCount()]; int i = 0; if(c.moveToFirst()) { do { str[i] = (c.getString (c.getColumnIndexOrThrow(body))).toString(); i++; }while(c.moveToNext()); } int j; int Myi; for (Myi=0; Myi str.length; Myi++) { if ( str[Myi].indexOf(hello) = 0 ) { MyMsg = str[Myi] ; Button buttonView = new Button(this); buttonView.setText( str[Myi]); layout.addView(buttonView,p); buttonView.setOnClickListener( new LinearLayout.OnClickListener() { public void onClick(View arg0) { Intent myIntent = new Intent(); myIntent.setClassName (com.android.tele, com.android.tele.Hello2); //myIntent.putExtra (com.android.HelloBye.heby, Hello Joe!); // key/value pair, where key needs current package prefix. myIntent.putExtra(nikvar, MyMsg); //myIntent.putExtra(niva, Martin);// key/value pair, where key needs current package prefix. startActivity(myIntent); } } ); } } } /* LinearLayout ms1=(LinearLayout)findViewById(R.id.ms1); ms1.setOnClickListener(new LinearLayout.OnClickListener() { public void onClick(View arg0) { Intent myIntent = new Intent(); myIntent.setClassName(com.android.tele, com.android.tele.Hello2); //myIntent.putExtra(com.android.HelloBye.heby, Hello Joe!); // key/value pair, where key needs current package prefix. myIntent.putExtra(nikvar, Ricky); //myIntent.putExtra(niva, Martin);// key/value pair, where key needs current package prefix. startActivity(myIntent); } }); */ }
[android-developers] Not a big problem.
Hi Developers. Now i have a small problem. I want to create a global variable in my program. Please give me the coding of create a global variable. Thanks in advance. Suman. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Display problem 2
Hello!!! surfaceView is not working. But thanks for reply. Am facing the same problem still now. I want to display the specific list of string.ma again posting the code. /// import android.app.Activity; import android.app.ListActivity; import android.content.ContentUris; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People; import android.provider.Telephony.Carriers; import android.telephony.gsm.SmsMessage; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class tele extends Activity { // Button ms1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); //ms1=(Button)findViewById(R.id.ms1); Uri uri = Uri.parse(content://sms/inbox); Cursor c= getContentResolver().query(uri, null, body like '%s %',null,null); // Cursor c = getContentResolver().query(Carriers.CONTENT_URI, null, null, null, null); startManagingCursor(c); if(c.getCount() !=0) { String[] str = new String[c.getCount()]; int i = 0; if(c.moveToFirst()) { do { str[i] = (c.getString (c.getColumnIndexOrThrow(body))).toString(); i++; }while(c.moveToNext()); } } } } /// Please give me some specific coding by which i can display the String [] str. Thanks in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Display problem.
Thanks for the greate help. But now i want to display list of strings. This code is helpful for converting the sms to string insteade of adapter. import android.app.Activity; import android.app.ListActivity; import android.content.ContentUris; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People; import android.provider.Telephony.Carriers; import android.telephony.gsm.SmsMessage; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class tele extends ListActivity { // Button ms1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); //ms1=(Button)findViewById(R.id.ms1); Uri uri = Uri.parse(content://sms/inbox); Cursor c= getContentResolver().query(uri, null, body like '%s %',null,null); // Cursor c = getContentResolver().query(Carriers.CONTENT_URI, null, null, null, null); startManagingCursor(c); if(c.getCount() !=0) { String[] str = new String[c.getCount()]; int i = 0; if(c.moveToFirst()) { do { str[i] = (c.getString (c.getColumnIndexOrThrow(body))).toString(); i++; }while(c.moveToNext()); } / new ArrayAdapterString(this, R.id.row_entry, str); /// } } } / Please help me how can i display the list of strings. I want to display String[] str. Kindly remember i have to search the strings . So want the list of strings not the listadapter. Thanks a lot in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Moving screen
Hi developers ... I want to create a moving background in my application. Can anyone help me. Thanks in advance. please help me. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Unique problem only for the EXPERTS.
Hi! am Suman. I have a code by which i can access all the sms from inbox. The code is written below. import android.app.ListActivity; import android.content.ContentUris; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People; import android.provider.Telephony.Carriers; import android.telephony.gsm.SmsMessage; import android.view.View; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class niceandroid8 extends ListActivity { private ListAdapter mAdapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Uri uri = Uri.parse(content://sms/inbox); Cursor c = getContentResolver().query(uri, null, null, null,null); // Cursor c = getContentResolver().query(Carriers.CONTENT_URI, null, null, null, null); startManagingCursor(c); String[] columns = new String[]{body}; // Comment int[] names = new int[]{R.id.row_entry}; mAdapter = new SimpleCursorAdapter(this, R.layout.con1, c, columns, names); this.setListAdapter(mAdapter); } } xml coding is.. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=wrap_content TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Sms: / TextView android:id=@+id/row_entry android:layout_width=wrap_content android:layout_height=wrap_content / /LinearLayout Now my problem is i want to access those sms which have a specific string . As a example if any sms contains Hello. So i want to search the string. i have tried a lot. But i cant do this beacause i cant convert the Listadapter to String. Please help me and give me the correct code. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: Unique problem only for the EXPERTS.
Hi, Thanks a lot for the problem, but I'm still unfortunately at square one. Here is what I need: Read an SMS into a string variable, then do some string operations. For example, how can I find the first character of an SMS? Thanks in advance for helping me out. ### On 1/6/09, Ninad mnina...@gmail.com wrote: Hi.. All you need is simple SQL.. Modify the Cursor as: Cursor c= getContentResolver().query(uri, null, body like '%hello%', null,null); Since the query takes the following argument: public final Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) . Arguments: uri: The URI, using the content:// scheme, for the content to retrieve. projection: A list of which columns to return. Passing null will return all columns, which is discouraged to prevent reading data from storage that isn't going to be used. selection: A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the WHERE itself). Passing null will return all rows for the given URI. selectionArgs: You may include ?s in selection, which will be replaced by the values from selectionArgs, in the order that they appear in the selection. The values will be bound as Strings. sortOrder: How to order the rows, formatted as an SQL ORDER BY clause (excluding the ORDER BY itself). Passing null will use the default sort order, which may be unordered. I hope this solves your simple query for 'experts'! On Jan 6, 9:31 am, ipeg.stud...@gmail.com wrote: Hi! am Suman. I have a code by which i can access all the sms from inbox. The code is written below. import android.app.ListActivity; import android.content.ContentUris; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Contacts.People; import android.provider.Telephony.Carriers; import android.telephony.gsm.SmsMessage; import android.view.View; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleCursorAdapter; public class niceandroid8 extends ListActivity { private ListAdapter mAdapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Uri uri = Uri.parse(content://sms/inbox); Cursor c = getContentResolver().query(uri, null, null, null,null); // Cursor c = getContentResolver().query(Carriers.CONTENT_URI, null, null, null, null); startManagingCursor(c); String[] columns = new String[]{body}; // Comment int[] names = new int[]{R.id.row_entry}; mAdapter = new SimpleCursorAdapter(this, R.layout.con1, c, columns, names); this.setListAdapter(mAdapter); } } xml coding is.. ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=wrap_content TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Sms: / TextView android:id=@+id/row_entry android:layout_width=wrap_content android:layout_height=wrap_content / /LinearLayout /// / Now my problem is i want to access those sms which have a specific string . As a example if any sms contains Hello. So i want to search the string. i have tried a lot. But i cant do this beacause i cant convert the Listadapter to String. Please help me and give me the correct code. /// / --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] SMS Inbox: 2008's toughest problem ( At least for me)
### Please help me access the list of sms in the inbox. I am using this code, please let me know what is wrong, it always gives a n unexpected error popup in the emulator. I used a similar code for accessing the contacts list ( People.NAME etc ), it worked fine. However, I cannot do it for SMS inbox. Thanks in advance and happy new year! ### package org.anddev.android.hello; import android.app.ListActivity; import android.database.Cursor; import android.os.Bundle; import android.provider.Telephony.Sms; import android.widget.ListAdapter; import android.widget.SimpleCursorAdapter; public class HelloAndroid extends ListActivity { private ListAdapter mAdapter; /** Called when the activity is first created. */ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Cursor c = getContentResolver().query(Sms.Inbox.CONTENT_URI, null, null, null, null);//.query(Sms.CONTENT_URI, null, null, null, null); startManagingCursor(c); String[] columns = new String[]{Sms.Inbox.READ}; int[] names = new int[]{R.id.row_entry}; mAdapter = new SimpleCursorAdapter(this, R.layout.main, c, columns, names); this.setListAdapter(mAdapter); } } ### Here is the main.xml code ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android android:orientation=horizontal android:layout_width=fill_parent android:layout_height=wrap_content TextView android:layout_width=wrap_content android:layout_height=wrap_content android:text=Name: / TextView android:id=@+id/row_entry android:layout_width=wrap_content android:layout_height=wrap_content / /LinearLayout # --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Please help: Need to access SMS inbox
my name is Suman. i can notify a incoming sms. the code is written belowimport android.content.BroadcastReceiver; import android.content.ContentUris; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.telephony.gsm.SmsMessage; import android.util.Log; import android.widget.Toast; public class SMSReceiver1 extends BroadcastReceiver { /** TAG used for Debug-Logging */ protected static final String LOG_TAG = SMSReceiver; /** The Action fired by the Android-System when a SMS was received. * We are using the Default Package-Visibility */ private static final String ACTION = android.provider.Telephony.SMS_RECEIVED; // @Override public void onReceive(Context context, Intent intent) { Log.i(LOG_TAG, [inside onReceive] ); if (intent.getAction().equals(ACTION)) { StringBuilder sb = new StringBuilder(); Bundle bundle = intent.getExtras(); if (bundle != null) { Object[] pdusObj = (Object[]) bundle.get(pdus); SmsMessage[] messages = new SmsMessage [pdusObj.length]; for (int i = 0; ipdusObj.length; i++) { messages[i] = SmsMessage.createFromPdu ((byte []) pdusObj[i]); } Log.i(LOG_TAG, [SMSApp Bundle] + bundle.toString ()); // Feed the StringBuilder with all Messages found. for (SmsMessage currentMessage : messages){ sb.append(Received compressed SMS\nFrom: ); // Sender-Number sb.append (currentMessage.getDisplayOriginatingAddress()); String value2 = currentMessage.getDisplayOriginatingAddress(); // String value4 = value2.toString(); sb.append(\nMessage\n); // Actual Message-Content sb.append(currentMessage.getDisplayMessageBody ()); String value3 = currentMessage.getDisplayMessageBody(); ContentValues contentValues = new ContentValues(); contentValues.put (android.provider.Telephony.Sms.BODY, currentMessage.getDisplayMessageBody()); android.net.Uri uri =context.getContentResolver().insert (android.provider.Telephony.Sms.CONTENT_URI, contentValues); // Intent myIntent = new Intent(); //myIntent.setClassName(com.android.sms14, com.android.sms14.SMSActivity1); //myIntent.putExtra(com.android.HelloBye.heby, Hello Joe!); // key/value pair, where key needs current package prefix. //myIntent.hasExtra(('niva', '+value2+')); //myIntent.hasExtra(('niva', '+value3+')); //myIntent.putExtra(niva, Sengupta);// key/value pair, where key needs current package prefix. //startActivity(myIntent); //ContentValues contentValues = new ContentValues(); // contentValues.put (android.provider.Telephony.Sms.BODY, currentMessage.getDisplayMessageBody()); //Uri uri =context.getContentResolver().insert (android.provider.Telephony.Sms.CONTENT_URI, contentValues); //sb.append(uri); } } // Logger Debug-Output Log.i(LOG_TAG, [SMSApp] onReceiveIntent: + sb); // Show the Notification containing the Message. Toast.makeText(context, sb.toString(), Toast.LENGTH_LONG).show(); // Consume this intent, that no other application will notice it. this.abortBroadcast(); // Start the Main-Activity Intent i = new Intent(context, SMSActivity1.class); i.setClassName(com.android.sms14, com.android.sms14.SMSActivity1); i.putExtra(fname, suman999); i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(i); } } } main activity: import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; public class SMSActivity1 extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // setContentView(R.layout.sms1); Log.v(SMSReceiver1.LOG_TAG,inside SMS Activity); } } mainfest manifest xmlns:android=http://schemas.android.com/apk/res/android; package=com.android.sms14 uses-permission android:name=android.permission.RECEIVE_SMS / application