Questions tagged [android-internet]

This tag is used for internet related questions on the Android Operating System.

228 questions
0
votes
5 answers

Android is returning a String after 'AsyncTask'

Here is my code: import java.io.BufferedReader; import java.io.InputStreamReader; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import…
PeakGen
  • 21,894
  • 86
  • 261
  • 463
0
votes
0 answers

Block Internet Access for a specific app (root)

I am trying to force speech recognition to work offline in Android 4.1+. Google doesn't allow developers to specify if they want recognition to be done offline, but if the internet connection of a device is off then it will run in offline mode. I…
Ryan S
  • 4,549
  • 2
  • 21
  • 33
0
votes
2 answers

Most efficient approach to constantly check Android device's internet connectivity

I have a requirement in my application wherein my app should always be connected to the internet(2G/3G only).To achieve this one can create a service which keeps checking if the device is connected to the internet or not.If not, then we can…
Basher51
  • 1,319
  • 1
  • 17
  • 28
0
votes
5 answers

Android app crashes on network request

I have integrated a currency converter in my app but when I try to get the results from the internet the app crashes. I am getting an error about: android.os.NetworkOnMainThreadException, some people say you have to add asynctask in order to fix the…
0
votes
1 answer

Android Client App with 3G and WIFI Network

I'm developing an application that need an internet permission all the time. When there is a WIFI connection the application can connect to my server (if they're in the same network) actually I have 2 question.. 1) Lets say that the server is…
Elior
  • 3,178
  • 6
  • 37
  • 67
0
votes
1 answer

Android Http Post to REST Api

Hi I'm primarily an Android developer and am pretty clueless about http protocols, you help would be much appreciated! I am trying to make an api call to this: http://api.haikutest.com/developer/apidoc/assignments.html where I POST a file on the…
Ryan S
  • 4,549
  • 2
  • 21
  • 33
0
votes
2 answers

Close Application if no internet connection

OnCreate of my "Home" activity, I want to check if there's internet connection, if false just close my activity showing a toast.. But, my Home Activity could not be the first on stack, so if just set finish(); it could just close this activity and…
Tizianoreica
  • 2,142
  • 3
  • 28
  • 43
0
votes
1 answer

Connection setting with ACTION_WIRELESS_SETTINGS

can anyone guide on how to check internet connection setting with condition? I need something similar to this set of code. LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE); boolean enabled = service …
KS Tan
  • 111
  • 1
  • 1
  • 6
0
votes
2 answers

Background Service wakelock and thread

my app should check every X min. web content and I have to implement wakeLock as it should work when screen is off, but at the same time I have to use AsyncTask as it use network (which is banned in main thread). What is good method to be sure that…
0
votes
2 answers

How to set connection timeout for JSONParser.makeHttpRequest in Android?

I am getting and posting some data with JSONParser.makeHttpRequest. When the connection is slow it takes a while to get a response and I would like to set the timeout limit to 5 seconds. I found this post showing how to set HttpResponse timeout but…
Engin Yapici
  • 5,673
  • 5
  • 22
  • 32
0
votes
0 answers

Monitoring android default browser link click and its status in custom application

We cannot monitor default browser links activity through either listeners or console logs since it is termed as a privacy violoation Ref: Get the current page being viewed in the browser (Possible?) I tried using my own custom web view to override…
0
votes
2 answers

Not able to get NodeList from asynch task

The objective of below snippet is used for parsing the xml. In that AsynchTask is used for internet connection, However I am getting NullPointerException on the line before the for loop.. here is a snippet and stacktrace.. public class…
0
votes
1 answer

What happens when downloading an inputstream is interrupted

I have the following line of code to download a Bitmap: bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream()); But what happens if the download is interrupted mid-download? Will the connection stay open? If yes, should I start a…
Maarten
  • 6,894
  • 7
  • 55
  • 90
0
votes
8 answers

How to determine the network unavailability in android

I want to show alert that connection not available in my android application. I am calling some rest request in my application. To check this network unavailability scenario I manually disconnect my wifi in my laptop (I am testing in simulator)…
Ankit HTech
  • 1,863
  • 6
  • 31
  • 42
0
votes
2 answers

Saving draft emails in android

I have an app from which we can send emails .I need some help with the email sending. If the the internet is not available need to store the mail and when connection available send the saved mails.Which is the effective option to save the draft…
arun
  • 245
  • 1
  • 3
  • 12