android-asynctask

Transfer data from android to java desktop application

梦想的初衷 提交于 2020-01-06 08:17:29
问题 I run an application in Android and a string value as an answer. Now I want to pass this result to the Java server which is on my localhost, i.e pass the value from Android code to Java desktop application. I tried using this code, but when I run the client it says unfortunately the application has stopped. It says: android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1145) libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84) libcore.io.IoBridge.connectErrno(IoBridge.java

Transfer data from android to java desktop application

徘徊边缘 提交于 2020-01-06 08:17:10
问题 I run an application in Android and a string value as an answer. Now I want to pass this result to the Java server which is on my localhost, i.e pass the value from Android code to Java desktop application. I tried using this code, but when I run the client it says unfortunately the application has stopped. It says: android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1145) libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84) libcore.io.IoBridge.connectErrno(IoBridge.java

progress dialog keeps on displaying

你说的曾经没有我的故事 提交于 2020-01-06 08:07:26
问题 I have written a long code in android and which displays a progress dialog when the restaurant list is loaded into the listview. Now the problem is that its working fine when restaurant list is loaded again on users filter changes but only at the first time. it just keeps on displaying even if the listview is populated and user has to manually dismiss it pressing the back button of deivce. I dont knw where to write pg.dismiss() in this case. Posting my code here . plz advise me.. package com

progress dialog keeps on displaying

↘锁芯ラ 提交于 2020-01-06 08:07:22
问题 I have written a long code in android and which displays a progress dialog when the restaurant list is loaded into the listview. Now the problem is that its working fine when restaurant list is loaded again on users filter changes but only at the first time. it just keeps on displaying even if the listview is populated and user has to manually dismiss it pressing the back button of deivce. I dont knw where to write pg.dismiss() in this case. Posting my code here . plz advise me.. package com

progress dialog keeps on displaying

倾然丶 夕夏残阳落幕 提交于 2020-01-06 08:07:14
问题 I have written a long code in android and which displays a progress dialog when the restaurant list is loaded into the listview. Now the problem is that its working fine when restaurant list is loaded again on users filter changes but only at the first time. it just keeps on displaying even if the listview is populated and user has to manually dismiss it pressing the back button of deivce. I dont knw where to write pg.dismiss() in this case. Posting my code here . plz advise me.. package com

Using AsynTask to show progress bar while attempting to SSH to Server

走远了吗. 提交于 2020-01-06 07:16:35
问题 First of all, i have to state that i am new to Java in general & Android. I do however have the basics, or at least getting there. The Purpose of my Application: At the company, we have a Remote server that we SSH to, and do some work. At some times, the server is unreachable and therefore disrupts our work. My application is suppose to do the following: 1- Using Jsch, i SSH to the server, if there is a response, then, i will attempt again in 15 minutes, if there is no response, i want to

24 Hour Android app connection with PHP web server

*爱你&永不变心* 提交于 2020-01-06 06:59:54
问题 My goal is to download some information from a PHP web server. I have created a service to run 24 hours. App start this service using alaram manager class. Intent ishintent = new Intent(this, AlarmReceiver.class); PendingIntent pintent = PendingIntent.getBroadcast(this, 2523, ishintent, PendingIntent.FLAG_UPDATE_CURRENT); AlarmManager alarm = (AlarmManager) getSystemService(Context.ALARM_SERVICE); alarm.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), 15000, pintent);

Android: update single Room column with Dao call from repository?

隐身守侯 提交于 2020-01-06 05:51:10
问题 I have a Room database and RecyclerView that shows a list of CardViews. One of the database columns holds Sort Index values so the CardViews can easily be sorted and moved within the RecyclerView list. I have a Dao call to update the Sort Index values whenever a CardView is moved, deleted or added. Room requires CRUD on a background thread and the syntax I have in the AsyncTask() in the respository that calls the Dao method is wrong. I am trying to pass the individual "int" sortOrders and the

Passing parameters in HttpAsyncTask().execute()

╄→尐↘猪︶ㄣ 提交于 2020-01-06 04:24:06
问题 My android app posts a string to web server using json and Http post and following code structure is used, but i want to pass few parameters to AsyncTask<> class through HttpAsyncTask().execute("from here"). can any one help me how to do it.. your help will be greatful for me thanks in advance btn_send.setOnClickListener(new OnClickListener(){ @Override public void onClick(View v) { // TODO Auto-generated method stub String strData = "Some String to post"; String strURL = "http://My-Url/";

Can't touch views from onPostExecute's AsyncTask

久未见 提交于 2020-01-06 02:35:07
问题 I have already read all questions about this. And it's not the same case. Believe me. I know an AsyncTask doInBackground function has his own thread, and you must touch the view in onPreExecute and onPostExecute. Besides, I'm using isCancelled and isFinishing to really be sure the task is alive. And with all these things, the app is still crashing. This is the code: public class MainActivity { private Activity activity; @Override protected void onCreate(Bundle savedInstanceState) { super