[android-developers] Re: Data connectivity problem.Server failed to communicate
found the solution.. it was the problem with tomcat web-server.. when i switched to XAMPP web- server everything worked just fine... does'nt android support tomcat web server?? On Jan 18, 9:27 am, "g...@devicedriven" wrote: > Can any body tell me why this is happening..Whenever i try to open a > website located in the intranet server,(or even a local machine with > tomcat web server) i get this message...Data connectivity > problem..Server failed to communicate.Please try again later... > The browser works fine for all other websites..i tried > google,youtube,yahoo,etc..all of them worked fine.. > Do i need to set any other value in the emulator?? > Any one else got the same 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] Re: How to perform socket communication
i think your problem is the ip address..127.0.0.1 is the device/ emulator itself not the machine on which you are programming...if you need to call localhost u should try this address-->10.0.2.2 read this too-->http://developer.android.com/guide/appendix/faq/ Regards Gino On Jan 22, 12:44 pm, saikiran n wrote: > Hi > I have done socket communication in a single application it is working fine > But my requirement is i have opened two emulators and i am able to send sms > between those two. > Now i want to run server in one emulator(myavd-5554) > and client on another emulator(myavd1-5556) > I have used the following code > on Serverside > public class TCPServerActivity extends Activity { > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > Thread sThread = new Thread(new TCPServer()); > sThread.start(); > try { > Thread.sleep(9); > } catch (InterruptedException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > Log.d("","Server activity closed"); > } > > } > > public class TCPServer implements Runnable{ > > public static final String SERVERIP = "127.0.0.1"; > public static final int SERVERPORT = 3000; > > public void run() { > try { > Log.d("TCP", "S: Connecting..."); > > ServerSocket serverSocket = new ServerSocket(SERVERPORT); > while (true) { > Socket client = serverSocket.accept(); > Log.d("TCP", "S: Receiving..."); > try { > BufferedReader in = new BufferedReader(new > InputStreamReader(client.getInputStream())); > String str = in.readLine(); > Log.d("TCP", "S: Received: '" + str + "'"); > > } catch(Exception e) { > Log.e("TCP", "S: Error", e); > } finally { > client.close(); > Log.d("TCP", "S: Done."); > } > > } > > } catch (Exception e) { > Log.e("TCP", "S: Error", e); > } > } > > } > > on client side > public class TCPClientActivity extends Activity { > /** Called when the activity is first created. */ > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > Thread cThread = new Thread(new TCPClient()); > cThread.start(); > > Log.d("","Client activity closed"); > > } > > } > > public class TCPClient implements Runnable { > > public static final String SERVERIP = "127.0.0.1"; > public static final int SERVERPORT = 3000; > > public void run() { > try { > > InetAddress serverAddr = InetAddress.getByName(SERVERIP); > > Log.d("TCP", "C: Connecting..."); > Socket socket = new Socket(serverAddr, SERVERPORT); > String message = "Hello from Client"; > try { > Log.d("TCP", "C: Sending: '" + message + "'"); > PrintWriter out = new PrintWriter( new BufferedWriter( new > OutputStreamWriter(socket.getOutputStream())),true); > > out.println(message); > Log.d("TCP", "C: Sent."); > Log.d("TCP", "C: Done."); > > } catch(Exception e) { > Log.e("TCP", "S: Error", e); > } finally { > socket.close(); > } > } catch (Exception e) { > Log.e("TCP", "C: Error", e); > } > } > > } > > So i run Server application on 5554 first and then client application on > 5556 > But i didn't receved the message > Please help me > 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: Emulator Loading Error
hi sasikumar.. whats your s/m configuration?? even i get almost 4 such errors.. clicking on wait will resume them...i think this is due to limited resources.. im working on windows xp machine/1gb ram and using ganymade eclipse Regards Gino On Feb 15, 4:33 pm, "Sasikumar.S" wrote: > Hi, > > When i try to load my emulator it is showing 2 errors with 'Force Close' & > 'wait' Button. > > Error are :- > > Appplication Android Keyboard (in process com.android.inputmethod.latin) is > not responding > > Application Settings (in process com.android.settings) is not responding > > How to stop showing this?... > > Any suggestions?.. > > -- > Thanks & Regards > Sasikumar.S -- 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: Images from Xml
hii look at the following tutorial http://www.anddev.org/parsing_xml_from_the_net_-_using_the_saxparser-t353.html this explains xml parsing in a simple manner..or if you find that difficult you could use the default implementation of SAX parser ... Regards Gino On Feb 15, 5:52 pm, Eosproject wrote: > Hi everyone! Can somebody help wih such problem. > I need to take out of XML file images to view it on display using XML > parser. > I proclaimed in xml file passes to images. > > Using something like it: > > res/xml/game.xml > > > > > > > > > > > > > Is it clear?? > > So in java class I need to use XmlResourseParser -- 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 do i get the android unique id??
can any 1 tell me how to get an unique id from an android phone?? whenever i try to get the unique id from the phone as a string it always shows "android id" and no other unique hex values...how do i get that one?? String id=Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID); Log.i("Android is is:",id); the o/p which i get is like this in my log cat.. Android id is: android id how can i get that ..ahem unique hex id??? Thankx 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: how do i get the android unique id??
the funniest part is..on the emulator too its giving the value like "android id"..not null.. i explicitly checked it using a try catch. and i tried using it on a nexux one,,still same result.. On Mar 16, 8:12 pm, "Maps.Huge.Info (Maps API Guru)" wrote: > It might be a good idea, for testing on the emulator, to test the > Android ID for null and if it is, use some sort of default value. That > way, you can at least test your app with good data. That's what I do > anyway. > > -John Coryat -- 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: HttpsURLConnection returns -1 code on second request
@Arkaitz Which server are u using?? i also had the same problem with tomcat server...but after playing around with the code i finally got it right... Regards Gino On May 15, 11:21 pm, Arkaitz Jimenez wrote: > Hi all, > I think I'm experiencing the same > ashttp://groups.google.com/group/android-developers/msg/9d37d64aad0ee357 > This is Android 1.5 SDK. > I happen to call several times below code(which is in a method) with > the same url and it fails intermitently. > When it fails, there is no exception, the stream is empty so the > readConnection fails, and getResponseCode returns -1. > Global caching is disabled, setDefaultUseCaches(false); > > Any idea on how can I workaround this? > > HttpURLConnection connection = null; > try { > URL url = new URL(this.url); > connection = (HttpURLConnection) url.openConnection(); > connection.setRequestProperty("Authorization", "basic " + > Base64Coder.encodeString(user + ":" + password)); > connection.setRequestProperty("User-Agent", userAgent); > connection.connect(); > > readConnection(connection.getInputStream()); > > connection.disconnect(); > } catch (IOException ex) { > reportException(ex, connection.getResponseCode()) > } catch (ParserException ex) { > reportException(ex, connection.getResponseCode()) > } > > Thanks > > Arkaitz > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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] Eclipse Crashes
Whenever i try to open the layout.xml file in eclipse..eclipse crashes and exits without any messages.. However if i try to open the xml file without using the layout editor of ADT plugin everything is fineit will open as an editable file..the problem started only after i updated the latest version of ADT...before that everything was working fione. Does anyone else have the same problem?What should i do to rectify it?? -- 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: Eclipse Crashes
tion.start(Lorg/ eclipse/equinox/app/IApplicationContext;)Ljava/lang/Object;+84 j org.eclipse.equinox.internal.app.EclipseAppHandle.run(Ljava/lang/ Object;)Ljava/lang/Object;+135 j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication (Ljava/lang/Object;)Ljava/lang/Object;+103 j org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start (Ljava/lang/Object;)Ljava/lang/Object;+29 j org.eclipse.core.runtime.adaptor.EclipseStarter.run(Ljava/lang/ Object;)Ljava/lang/Object;+149 j org.eclipse.core.runtime.adaptor.EclipseStarter.run([Ljava/lang/ String;Ljava/lang/Runnable;)Ljava/lang/Object;+183 On Dec 11, 4:50 pm, "g...@devicedriven" wrote: > Whenever i try to open the layout.xml file ineclipse..eclipsecrashes > and exits without any messages.. > > However if i try to open the xml file without using the layout editor > of ADT plugin everything is fineit will open as an editable > file..the problem started only after i updated the latest version of > ADT...before that everything was working fione. > > Does anyone else have the same problem?What should i do to rectify it?? -- 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: Null pointer exception
Hi Jason I too was irked with the same exception which got called in some of my applications and i couldn't find the source for the exception.However i think i found the reason for it..Here is what i found: 1>This exception was called in all the programs in which i used arrays 2>Just try this://You have used two arrays in your program from[], and to[] Either try a static initialization like this-->String from[]=new String [YOUR_ARRAY_SIZE] OR Another option is to initialize them to any value(Even initialization with null is fine) This seemed to work for all my programs..hope it does for you too! PS:It would really help if you can tell which line of ur code throws the exception On Dec 31 2009, 9:33 pm, JasonMP wrote: > This is bizarre. > > It works fine from the OnItemClick() of my OnItemClickListener > attached to my ListView. Just not inside the onContextItemSelected. > *scratches head* > > On Dec 31, 9:57 am, JasonMP wrote: > > > yes, Select.class is another one of my files. throughout my app there > > are a few different calls to it, all done the same way i.e. "Intent i > > = new Intent(this, Select.class); startActivity(i);" > > > No where in Select.class do I make a call to start Select.class or > > Sheet.class. When its done it calls finish(); > > > in the onCreate() of Select.class I grab the extras from the invoking > > class with this line of code: > > > public class Select extends ListActivity{ > > > DBAdapter db = new DBAdapter(this); > > String slotName = null; > > > @Override > > public void onCreate(Bundle savedInstanceState) { > > super.onCreate(savedInstanceState); > > > db.open(); > > > ListView list = getListView(); > > > View v = View.inflate(this, R.layout.list_header, null); > > list.addHeaderView(v, null, false); > > > name = > > this.getIntent().getStringExtra(DBAdapter.KEY_NAME); > > } > > > Could it be something in the .getIntent() method? or > > the .getStringExtra()? > > > On Dec 30, 7:19 pm, "Stephen @ gmail.com" > > wrote: > > > > Now that I understand your intent creation a little better, and I see that > > > the intent you are creating is unique from the class in which the code > > > exists, I am not quite sure how it could be an infinite loop in the > > > (immediate) way I was thinking. > > > > Reading this code > > > > Intent i = new Intent(this, Select.class); > > > > I have to start thinking there's something wrong with this. I tried to > > > look > > > up the "Select" class on the android developers site, and couldn't find > > > it. > > > Is that a class from another of your files? I guess I would wonder if the > > > code being invoked there, is somehow causing this class to be invoked, > > > thus > > > causing some kind of loop. I would grep for any reference to your Sheet > > > class, from anywhere else in your code, and that would likely be suspect. > > > > In general, the below is kind of a side topic, to maybe help you with > > > generic debugging. > > > > All the Best, Steve. > > > > *Ok... the only thing I can think to really help you is to start taking > > > advantage of logging. In your import list, I see you don't include the > > > logger code, so maybe you can give this a shot. > > > > 1) in the import list > > > > import android.util.Log; > > > > 2) and throughout your code > > > > Log.d( TAG, DebugText ); > > > > where TAG is a string that is unique to you, and "DebugText" is something > > > useful to identify the part of the program you're interested in. > > > > * > > > > On Wed, Dec 30, 2009 at 11:32 AM, JasonMP wrote: > > > > Ok, I'm suddenly very curious by your previous statement stephen about > > > > the possibility of creating an infinite loop. Upon a little more > > > > investigation I'm now getting errors all over the place...same > > > > errorjust at different points in the app where I try to > > > > startActivity(intent); As soon as the new activity receives focus is > > > > crashes. > > > > > On Dec 30, 1:58 pm, JasonMP wrote: > > > > > package com.mallet.dtool; > > > > > > import android.app.AlertDialog; > > > > > import android.app.TabActivity; > > > > > import android.app.AlertDialog.Builder; > > > > > import android.content.DialogInterface; > > > > > import android.content.Intent; > > > > > import android.content.DialogInterface.OnClickListener; > > > > > import android.content.res.Configuration; > > > > > import android.database.Cursor; > > > > > import android.graphics.Color; > > > > > import android.os.Bundle; > > > > > import android.view.ContextMenu; > > > > > import android.view.KeyEvent; > > > > > import android.view.Menu; > > > > > import android.view.MenuItem; > > > > > import android.view.View; > > > > > import android.view.ContextMenu.ContextMenuInfo; > > > > > import android.widget.AdapterView; > > > > > import android.widget.ImageView; > > >
[android-developers] Re: How to use broadcast receivers
You can write an application with just a broadcast receiver..but u need to register them in ur mainfest file as you can pass the intent filters in this itself like this the above receiver will be called whenever you receive an sms in your phone On Dec 31 2009, 12:05 am, nightstriker wrote: > Is it possible to use just a broadcast receiver without any > activities? I just want to run some sample code only when the phone > receives a call and nothing more. I use Log.d to write out but I don't > see anything in the log. Am I missing something here? I also have > permissions set in the androidmanifest.xml to allow for these type of > intents. > > Please advise. -- 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 know internet data usage??
Are there any inbuilt classes ya methods that help to count the number of bytes sent/received...I'm trying to develop a light weight browser and am doing this as an option.As mobile users are charged based on the bytes they browse..i think this is a mandatory requirement,,but the more i google it he less i find...can any one 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] Re: No route to host issue, but Browser application works fine
yup..you can refer to the localhost by this ip-->10.0.2.2 This is because when you are specifying localhost to the device/ emulator it is a reference to the phone\emulator itself and not the local machine read this too-->http://developer.android.com/guide/appendix/faq/ commontasks.html#localhostalias On Jan 7, 7:15 am, Kenn Min Chong wrote: > OKOK, I think I found out what the issue is, but can't explain why. I > was trying to connect to a webservice located on the same machine as > the emulator was running. I tried referring to the local machine by IP > and by name, but I always get the "no route to host" error. But when I > connect to the same webservice, but hosted on a different machine > altogether, it works fine! So, what am I missing here? > > On Jan 6, 8:55 pm, Kenn Min Chong wrote: > > > I don't get it. I'm having this issue in the emulator. Is this an > > emulator only issue or it affects real devices too? This used to not > > do this, did a recent SDK update break this functionality? > > > On Jan 6, 8:28 pm, Wayne Wenthin wrote: > > > > You are not alone. I have this every once in awhile, I know that they > > > have already logged in due to where it generates the error. It's > > > annoying > > > to say the least. I'm now working on catching the exception and retrying > > > since it is just trying to put a json object to my server > > > > On Wed, Jan 6, 2010 at 3:07 PM, Kenn Min Chong wrote: > > > > > Hey guys! > > > > So, this is very frustrating. I already have > > > > > > > > permission> > > > > > in my manifest, but when my application tries to make a webservice > > > > call (I'm using a HttpURLConnection object to do this via connect() > > > > method), I'm getting an exception of "No route to host". > > > > > The built-in Browser application is able to access the internet > > > > properly, so I'm guessing it's something in my project. Any ideas? > > > > > Kenn. > > > > > -- > > > > 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 > > > > -- > > > Writing code is one of few things > > > that teaches me I don't know everything. > > > > Join the Closed Beta of Call Girl Managerhttp://www.fuligin.com/forums > > -- 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: Alarm
IF as mark told u need to use an alarm manager class,here is an example: Intent alrm_intent=new Intent(this,alarmreceiver.class); /*alarmreceiver.class-->this is another class which receives the alarm broadcast which we are going to broadcast*/ AlarmManager alm=(AlarmManager)getSystemService(ALARM_SERVICE); PendingIntent alrm_pending=PendingIntent.getBroadcast(this,0 , alrm_intent, 0); /i assume you are using a time picker to get the time when the alarm should go off.The next few lines calculate the time which is left for alarm to fire in milliseconds/ Calendar alrm_cal=Calendar.getInstance(); alrm_cal.setTimeInMillis(System.currentTimeMillis()); alrm_cal.set(alrm_cal.get(Calendar.YEAR), alrm_cal.get (Calendar.MONTH), alrm_cal.get(Calendar.DAY_OF_MONTH), alhr, almin); /**alhr-->hour in which alarm should fire almin-->minute in which alarm should fire**/ long diff_inmillis=alrm_cal.getTimeInMillis()- System.currentTimeMillis(); //now set the alarm using alarm manager alm.set(AlarmManager.RTC_WAKEUP,System.currentTimeMillis() +diff_inmillis ,alrm_pending); Now alarm receiver class should be something like this--> public class alarmreceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { /*DO WHAT EVER YOU WANT TO DO HERE THIS METHOD WILL GET CALLED WHEN THE ALARM IS FIRED!/ } } one more step-->you have to register the receiver in the manifest file like this inside the application tag itself Regards Gino On Jan 10, 4:15 pm, Ali Murtaza wrote: > hi > Can anyone tell how to set alarm using my application.. give me the > refference of the API > > -- > Ali Murtaza > > BCSF06M021 > Research Assistant > Data Virtulization Ware House > PUCIT, Lahore, Pakistan > ali.murt...@pucit.edu.pk -- 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: Eclipse Crashes
well..i havent found out a solution..but my problem was solved after i removed everything(Eclipse,plugins,and android SDK). Then i reinstalled everything from scratch and now it works quite fine!! Though it is a bit irksome it works and havent caused any more problems since.. On Jan 11, 3:24 pm, LambergaR wrote: > Anyone found a solution? This issue is quite annoying from time to > time :) > > On Dec 14 2009, 6:28 am, Mike wrote: > > > I'm using Ganymede with the latest release of the Android SDK (2.0.1) > > and I'm experiencing a similar problem. I'm pretty sure I noticed > > this issue with the 2.0 SDK as well. > > > For me, I notice the problem will occur as I am editing an XML layout > > while on the text editor tab and the last 3 or 4 characters I type > > will not be reflected in the editor. When I try to save, Eclipse will > > popup a dialog saying an error occurred and it needs to exit. I am > > not using my computer with my Eclipse environment right now, but when > > I do, I'll include what information I can about the error. > > > This happens fairly frequently for me (4 or more times a day) and is > > annoying. The only workaround is to exit Eclipse and start it up > > again. > > > - Mike > > > On Dec 11, 4:50 am, "g...@devicedriven" wrote: > > > > Whenever i try to open the layout.xml file in eclipse..eclipse crashes > > > and exits without any messages.. > > > > However if i try to open the xml file without using the layout editor > > > of ADT plugin everything is fineit will open as an editable > > > file..the problem started only after i updated the latest version of > > > ADT...before that everything was working fione. > > > > Does anyone else have the same problem?What should i do to rectify it?? > > -- 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] Data connectivity problem.Server failed to communicate
Can any body tell me why this is happening..Whenever i try to open a website located in the intranet server,(or even a local machine with tomcat web server) i get this message...Data connectivity problem..Server failed to communicate.Please try again later... The browser works fine for all other websites..i tried google,youtube,yahoo,etc..all of them worked fine.. Do i need to set any other value in the emulator?? Any one else got the same 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