tag:blogger.com,1999:blog-2244709367618477424.post7759013792471732890..comments2023-11-05T14:35:01.489+05:30Comments on DJ-Android: Connecting mysql Database in ANDROID using PHP & JSONdj-androidhttp://www.blogger.com/profile/11642235915599273668noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-2244709367618477424.post-6281366171344894802014-04-04T12:47:46.255+05:302014-04-04T12:47:46.255+05:30on defining items as String it is giving error on ...on defining items as String it is giving error on items.add("List") :<br />The method add(String) is undefined for the type String.Anonymoushttps://www.blogger.com/profile/03299384046176283839noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-3810989912327371502013-09-28T20:14:41.487+05:302013-09-28T20:14:41.487+05:30Can you extend this example by including also clic...Can you extend this example by including also clicking on the items of the Listview and taking the id in each row of the list to display them in a 2nd activity?<br />It would be really interesting.. :-)Anonymoushttps://www.blogger.com/profile/04935158178899697190noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-16535223054457230582013-09-28T15:03:32.423+05:302013-09-28T15:03:32.423+05:30sorry you have to watch & develop code... i ha...sorry you have to watch & develop code... i have't upload code of this exampledj-androidhttps://www.blogger.com/profile/11642235915599273668noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-80940787818253017922013-09-26T00:48:57.762+05:302013-09-26T00:48:57.762+05:30Where can I download the code from?
Thank you..Where can I download the code from?<br />Thank you..Anonymoushttps://www.blogger.com/profile/04935158178899697190noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-73382531373607538142013-09-03T18:08:52.331+05:302013-09-03T18:08:52.331+05:30if you are get this ---> {"emp_id":&q...if you are get this ---> {"emp_id":"1234567890","emp_name":"Sample Name"} mean you got the result. now time to do json parsing.dj-androidhttps://www.blogger.com/profile/11642235915599273668noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-57182981879363678792013-09-03T14:59:06.237+05:302013-09-03T14:59:06.237+05:30Sorry. Error may not have been the best choice of ...Sorry. Error may not have been the best choice of word. There is actually no error message given in logcat. When I run the hp file in the browser using localhost, it shows <br /><br />{"emp_id":"1234567890","emp_name":"Sample Name"}<br /><br />When I run the program in my Android phone, and message shows <br /><br />"no data found {"emp_id":"1234567890","emp_name":"Sample Name"}" . <br /><br />Through experimentation, I managed to remove the message from appearing when I run the program on my phone by deleting the <br /><br />Toast.makeText(this, "no data found" + result, Toast.LENGTH_LONG).show();<br /><br />line on the last try{} group in your code. My new question is, would removing that line have a significant effect on the program as a whole? Thanks again for helping me on this.Anonymoushttps://www.blogger.com/profile/00007936679156335194noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-8118979143119297712013-08-31T23:17:16.828+05:302013-08-31T23:17:16.828+05:30Could you show me what type of error you get? Mean...Could you show me what type of error you get? Mean show me error logs.<br /><br />Hint: run your php file in browser (chrome or any other) in local server (http://192.168.0.3/projects/test.php) online (http://xyz.com/projects/test.php) check there is any error if not then add INTERNET & Access network state permission in your android project.<br /><br />Do above things...<br />dj-androidhttps://www.blogger.com/profile/11642235915599273668noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-49390962117080060572013-08-31T21:56:29.034+05:302013-08-31T21:56:29.034+05:30I've managed to make the program work. However...I've managed to make the program work. However, I seem to encounter an unexpected error. What is shown on the browser when I run the php file separately also shows when I run the application on my Android phone. Any thoughts on what may be the cause? Thanks!Anonymoushttps://www.blogger.com/profile/00007936679156335194noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-8718409734313555472013-08-29T23:28:52.227+05:302013-08-29T23:28:52.227+05:30This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/00007936679156335194noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-2196998720044920212013-08-12T12:01:40.409+05:302013-08-12T12:01:40.409+05:30result is String, is = input stream....result is String, is = input stream....dj-androidhttps://www.blogger.com/profile/11642235915599273668noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-23840245161097313382013-08-11T23:36:07.114+05:302013-08-11T23:36:07.114+05:30Can you please tell the declaration for sb and res...Can you please tell the declaration for sb and result? Thanks!Anonymoushttps://www.blogger.com/profile/00007936679156335194noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-68769897745242707102013-05-21T21:13:13.180+05:302013-05-21T21:13:13.180+05:30You have added internet permission in android mani...You have added internet permission in android manifest file??<br /><br />http://stackoverflow.com/questions/2378607/what-permission-do-i-need-to-access-internet-from-an-android-applicationdj-androidhttps://www.blogger.com/profile/11642235915599273668noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-7416945911875620242013-05-21T17:20:04.221+05:302013-05-21T17:20:04.221+05:30Thank you.But when the app starts i encounter this...Thank you.But when the app starts i encounter this error<br />05-21 17:11:58.115: E/log_tag(410): Error in HTTP connectionjava.net.SocketException: Permission denied<br />05-21 17:11:58.146: E/log_tag(410): Error in convert Stringjava.lang.NullPointerException<br />Sabhahttps://www.blogger.com/profile/11983778954115953419noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-79581519237973950242013-05-21T15:55:02.335+05:302013-05-21T15:55:02.335+05:30Both items & is are Global Variable. like:
pu...Both items & is are Global Variable. like:<br /><br />public class mainActivity extends Activity{<br /><br />public ArrayList items = new arrayList();<br />String is;<br /><br />@Override<br /> public void onCreate(Bundle savedInstanceState)<br /> // rest of all code<br />}<br /><br />}dj-androidhttps://www.blogger.com/profile/11642235915599273668noreply@blogger.comtag:blogger.com,1999:blog-2244709367618477424.post-20745820822759056392013-05-21T08:27:19.255+05:302013-05-21T08:27:19.255+05:30Hi
I tried ur coding.I have got an error that the...Hi<br /> I tried ur coding.I have got an error that the variables "items" and "is" can not be resolved.Where it should be declared.Sabhahttps://www.blogger.com/profile/11983778954115953419noreply@blogger.com