Android :: Handle Unexpected Internet Disconnect While Downloading Data
Mar 31, 2010
I have here a function that downloads data from a remote server to file. I am still not confident with my code. My question is, what if while reading the stream and saving the data to a file and suddenly I was disconnected in the internet, will these catch exceptions below can really catch that kind of incident? If not, can you suggest how to handle this kind of incident?
I call this function in a thread so that the UI won't be blocked.
CODE:...................
View 1 Replies
Jun 15, 2012
When i downloading torrents using my android phone over the WiFi, its connection lost several times. My phone WiFi policy is "Keep WI-Fi on during sleep" as "Always". I use "Torrent" app client. Most of the time Torrent display "No suitable network" error. If i turn on the screen, problem not fix.
I have android 4.0.3 ROM and i connected my phone into my ADSL router, not a public.
View 8 Replies
View Related
Feb 26, 2009
In my Android program, I have some code that downloads a file. This works fine, but since on a cell phone, you can be disconnected at any time, I need to change it do it reconnects and resumes the download when you are halfway through and somebody calls/you lose cell reception/etc. I cannot figure out how to detect the InputStream has stopped working. See the code...
And then my program just hangs on the while( (len1 = etc. I need to make it so when the Internet gets disconnected I wait for the Internet to be connected again and then resume the download.
View 1 Replies
View Related
Jun 7, 2010
I open up a friends Twitter profile and clicked the profile pic because I wanted to save it to my phone to use as their contact photo. Obviously I could download the photo from the Twitter client so I chose to view the pic via internet to my surprise I still couldn't download the photo.it allows me to view but no download option. I'm I overlooking something or do I need to use a different browser?
View 5 Replies
View Related
Jun 8, 2010
I have just gotten my first Android based device, the HTC Droid Incredible.
I am not new to the world of smartphones (I have owned a Blackberry and have worked on many other Blackberries), but I am new to the whole world of Android.
I really do like it so far, but I have a question...
How does Android handle data? What I mean by this question is this: Does Android use a store and forward approach to sending data (emails)? Or does it send it out and if it doesn't have a good connection, it will just fail out, never to try again?
And based on the fact that it uses data, I also assume that it will never lose it's data connection even though a cell phone tower might be buried under voice calls?
The reason I ask this is because during 9/11, many people's cell phones could not make or receive calls but those who had some of the first Blackberries were able to send and receive emails just fine due to the store and forward approach.
Also, another reason is that this device will be used in a SHTF type of situation due to it's capabilities and I want to make sure that it will work with data (sending emails), although I may not be able to make voice calls with it.
View 1 Replies
View Related
Jun 14, 2009
This is a general architectural question. I want to offer a user a simple two page form. The first page will have a few Spinners for the user to select options from. The second page will have a series of EditTexts for the user to fill in. After the second page, the user clicks a button to generate a text file based on the values they have input. My question is: What is the best way to handle preserving the data from the spinners on the first page of the form, in order to place them into the text file? I feel like the "architecture" should be something like this: 1. User selects Spinner values on first page and clicks button to move to next page of form.. 2. Spinner values are placed in database 3. User fills in EditTexts on second page. Clicks button to generate text file. 4. Database is queried for Spinner values, which are added to newly created text file, then EditText values are added Does this strategy make sense? Does anyone have advice on a better way of handling the gathering of two pages of form input then using it to create a text file? The user would need to be able to flip back and forth between the form pages as needed.
View 4 Replies
View Related
Apr 8, 2010
I have an Observable and an Observer. The observable does download some stuff in a background thread and calls notifyObservers to let the observers read the status. At some point in public void update the observer tries to updates the GUI Is there some way I can prevent this from happening? I'm sure I'm missing something obvious here.
View 2 Replies
View Related
Jan 29, 2010
Rogers has disabled internet on their HTC Dream phones (among others).There is a software update that must be done, but you need to back up your data, etc.before doing the update.I do NOT have any backup apps on my phone. Without internet, I cannot get to the market to download one.How am I supposed to backup my Dream?
View 4 Replies
View Related
Jun 26, 2010
I will be making a mobile application in Android. My application is like Google Map's Get Direction feature, but a lot more complex, so I need to store data about points in the map. So I'm worried that SQLite may not be able to handle these large amount of data(or considering the limited storage of the phone). I have no background in SQLite so please bear with me.
View 3 Replies
View Related
Mar 25, 2009
I want to receive the data from the preview of the Camera, but without having to set a SurfaceView with a SurfaceHolder in the view of my application. I want to do something like this: Camera cam = Camera.open(); cam.setPreviewCallback(new MyPreviewCallback()); cam.startPreview(); This will not work because I need to call setPreviewDisplay (SurfaceHoler) before I start the preview. I can get a SurfaceHolder from a SurfaceView, but I don't want a SurfaceView, because I don't need one. I just want to handle the preview data by myself.
View 2 Replies
View Related
Jul 2, 2010
When I go to download songs etc from the internet it starts to load it like I'm streaming something.I had dtunes for this on my ipod. Is there anything like that for Evo?
View 1 Replies
View Related
Aug 16, 2010
I want to save the data on the web server. I have data in XML format and I know the URL String. Please tell me how can I send the request and handle the response.
View 1 Replies
View Related
Jun 10, 2010
I want to have a free version and a premium version of the same application. When people buy the application, I want them to be able to "upgrade" without losing their data, i.e. the premium version should install over the free version.I want to use the same code base and just switch a setting to build the premium version.
Andoid Market does not let me convert a free app to a paid app, so the trivial option is not available.I am curious if someone has tried this successfully. How does Android Market identify an application - will it think that the premium version is a different app and just install it in parallel?
View 2 Replies
View Related
Oct 8, 2010
do i have to root my phone to download games from gameloft
View 6 Replies
View Related
Nov 3, 2010
I have been having 3G issues on my captivate for a while. I can browse the web just fine and email, text, mms all fine. But downloading apps or things that need continuous internet download (i.e. speed test) will start then stop very slowly. The 3G window in the status bar will then flash occasionally but primarily stay unlit. I've hoped that it would continue to download, but after leaving my phone with the screen off for over an hour with an app downloading (only 2mb) gone from 20kb downloaded to 50kb and my battery went from 80 to 30. This happens for every app I attempt to download over 3G (wifi is perfectly fine) no matter what the size. Any idea why it seems to put the download into the background. I'm currently running cognition mod v2.3b2. This has happened on all versions of cognition I've had. I'm pretty sure it happened while I had stock 2.1 also.
View 4 Replies
View Related
Jul 28, 2010
I am in a deployed location in Afghanistan and within my compound, we utilize satellite internet and broadcast it via WIFI just for us who have paid. Some of the guys here have implemented a few security features so other people around us can hack our network. The WIFI is encrypted with WPA2 and a password.After that to surf on the internet on my laptop I have to input a proxy address of 10.10.8.2, I can connect to the wireless via my Desire, but I cant surf the internet, check email, or do anything that requires a data connection.Other people here have no problem getting their Ipod touches and Iphones on the WIFI.Is there some setting I am over looking because to me there are not a lot of settings I can change in the first place.If I need to download a program to help, please give info how to do so without an internet connection directly on the phone.
View 4 Replies
View Related
Sep 29, 2010
How do I download settings or 3G internet if my phone can't do it through basic settings: settings download?
View 1 Replies
View Related
Nov 5, 2009
Trying to download and save files off the net, whether from ftp sites or sites, getting an insufficient space error. I have 533MB free on my SD card and 308MB free on the internal storage.
View 1 Replies
View Related
Oct 13, 2010
My handset wont download the internet settings, this is despite me having the phone for 4 months.I have had it on the internet but when i factory reset i lost all my settings. Now i cant download the settings so is there any way i can download them through my PC or off the Sony website and if so how?
View 1 Replies
View Related
Oct 17, 2010
Well i have Handcent and have set it to pop up so i can reply system wide. While looking at You Tube videos it pops up i reply and when i go back to my video its just blank will not restart or anything else i have to hit back and click on the vid from the start. Its just annoying. Anyone know a work around this. I am Rooted i also have Tasker (but not that good where i can figure out how to do this) Does this happen to everyone is this just the network not being able to handle text and data at the same time. It worked fine on my old iphone.
View 3 Replies
View Related
Jun 10, 2010
Luckily I have the "NetCounter" network traffic counter installed, so I monitor my data usage over the 3g/2g network. Recently I've discovered my usage have increased massively. According to the month graph I've jumped from average 8 MB/day to approx 40 MB/day and my habbits haven't changed!This morning when I woke up, and my phone has been idle all night, it had already used 7MB since midnight - without me using it. What kind of a background app/service downloads that much data? According to my netcounter it is almost 99% download and 1% upload.I have a 1gb/month dataplan which should be enough, but something is appearently abusing my Connection , and with 410MB used this month so far, it can't last all month this way.I can see which date more or less the cell usage have increased, but I honestly can't recall which programs I have installed around that point! So before I try randomly uninstalling programs, I would like to hear if there is any way I can see how the network usage is distributed between the apps, so I can find the sinners?
View 8 Replies
View Related
Oct 27, 2010
Is there a way to do it within an app without downloading the file first? Somehow stream the text content?
View 1 Replies
View Related
Apr 12, 2010
I would like ask if there's a way to download an android layout from the Internet into the "res/layout" folder. I was thinking in getting the file using an HttpUrlConnection and a FileOutputStream, like discussed in here http://stackoverflow.com/questions/576513/android-download-binary-file-problems but I can't figure out how to put it into the "res/layout" folder.
View 1 Replies
View Related
Jun 25, 2010
I have been having some major problems with my EVO regarding the data. If I use anything that is on the heavy side of bandwidth, like downloading a file from android marketplace, surfing the web, watching sprint tv, using the GPS, etc...the data will just time out for about 3 min at a time. For instance if I am downloading a 5mb app from android marketplace, it will maybe download a megabyte, then it will just stop downloading. If you look at the 3G symbol at the top, it will be white, but only the upstream indicator will be on. I can then open any other internet application on the phone, and nothing will work. It usually lasts for about 3 minutes at a time and happens fairly regularly. It will end up taking me 15-20 min to download a 5mb file from the marketplace. Same thing if I browse a bandwidth heavy site like digg.com. It will just time out after a while and it will just show the upstream indicator as solid and not do anything in any program.
This problem is not location dependent. I have this issue at my apartment, at work, at my friend's house, at the Sprint store...anywhere. I live in South Denver.
In chronological order, this is what I have done to troubleshoot/fix the problem:
First noticed problem
Turned off phone/Turned back on
Rooted and installed custom version of 2.1 w/ Sense
Removed battery (power cycle)
Talk to Sprint cust care. They sent signal over that reactivated the phone (2x)
Did factory reset on phone and formatted SD card
Swapped phone at Sprint store with new one
So even after swapping my EVO with a new EVO from the Sprint store and not fooling with the phone at all, I am still having the same exact issue.
I am absolutely at wit's end with this and I have no idea what to do at this point.
Update (6/25):
I have not been able to test with Wifi yet, but I just had one of my coworkers that has the same phone to replicate the issue on his phone. He is having the same exact problem as me, he just didnt realize it.
We set our phones next to each other and downloaded Space Buster 3D Lite off the Android Marketplace. Mine crapped out about 2mb in and so did his. He wasnt able to surf or do anything else on his phone for a few minutes just like mine.
I'm wondering if this a network problem in our area or if there is a problem with the phone.
Also, I downloaded a continuous ping program and did 3,000 pings with no packet loss, so it seems to only happen with heavy data usage ie. saturating your bandwidth.
View 16 Replies
View Related
Aug 1, 2010
I don't have a Desire, but will be getting possibly the Desire HD or the next big release here in Europe. Anyway im planning on using a pay as you go plan, so im not going to have 3G. I'll mainly be using wifi.
So i just wanted to know if its possible to download any data using GPRS (i believe its called). Its really slow, but i could use it to check email and whatnot. Does the Desire allow this, or should u be on either wifi or 3G for it to work?
View 6 Replies
View Related
Jul 12, 2012
I've installed several games that need to download aditional game data, but so far I couldn't manage to download anything. For some reasons, the download never starts and it gives an error. I tried using logcat to see if there are any errors but I couldn't find a clue.
View 1 Replies
View Related
Aug 14, 2013
Today I was trying to download and update some apps via wifi but later I discovered that it was on mobile data and I received message from Operator/Carrier that I have crossed my data pack limit and using it further will be chargeable. Is there any way to stop or prevent downloading apps when phone is using Data Pack?
View 2 Replies
View Related
Jul 18, 2010
I am using a lot of Internet Possibly 15mb a day, is there an application to tell me what app is using up what usage?
View 1 Replies
View Related
Jan 4, 2010
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 The less I find?
View 2 Replies
View Related
Nov 21, 2010
I'm getting a "SAXParseException: Unexpected end of document" error when trying to parse an xml document on android. The document in question is from the google weather api, but it seems to throw the same error regardless of the xml file in question (as long as the xml is valid) so I suspect it's a problem with my approach, rather than the xml. This is being done as a learning exercise, so I've probably (hopefully) overlooked something obvious. I've run the xml through an online validator, and it comes back as being well formed. (Can't tell me if it's valid as I don't have a DTD, but I dont think I need the DTD to parse the xml). This is the code that I'm using to try and parse the file:
private void refreshForecast() URL url;
try { url = new URL( "http://192.168.1.66:8000/google4.xml");
URLConnection connection = url.openConnection();
HttpURLConnection httpConnection = (HttpURLConnection)connection;
int responseCode = httpConnection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
InputStream in = httpConnection.getInputStream();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
// falls over here parsing the xml.Document dom = db.parse(in);
} } catch (ManyExceptions e) { ....
} A cutdown version of the xml that produces the error is:
<?xml version="1.0"?>
<xml_api_reply version="1">
<weather>
<forecast_information>
<city>Hamilton</city>
</forecast_information>
</weather>
</xml_api_reply>
The stacktrace is:
11-20 06:17:24.416: WARN/System.err(406): org.xml.sax.SAXParseException: Unexpected end of document
11-20 06:17:24.416: WARN/System.err(406): at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:131)
11-20 06:17:24.416: WARN/System.err(406): at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:110)
11-20 06:17:24.426: WARN/System.err(406): at com.dave.nzweather.WeatherApp.refreshForecast(WeatherApp.java:159)
11-20 06:17:24.426: WARN/System.err(406): at com.dave.nzweather.WeatherApp.onCreate(WeatherApp.java:100)
11-20 06:17:24.426: WARN/System.err(406): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-20 06:17:24.438: WARN/System.err(406): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-20 06:17:24.438: WARN/System.err(406): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-20 06:17:24.446: WARN/System.err(406): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-20 06:17:24.446: WARN/System.err(406): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-20 06:17:24.456: WARN/System.err(406): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 06:17:24.456: WARN/System.err(406): at android.os.Looper.loop(Looper.java:123)
11-20 06:17:24.456: WARN/System.err(406): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-20 06:17:24.466: WARN/System.err(406): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 06:17:24.466: WARN/System.err(406): at java.lang.reflect.Method.invoke(Method.java:521)
11-20 06:17:24.466: WARN/System.err(406): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-20 06:17:24.476: WARN/System.err(406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-20 06:17:24.476: WARN/System.err(406): at dalvik.system.NativeStart.main(Native Method)
11-20 06:17:24.486: WARN/ROGER(406): org.xml.sax.SAXParseException: Unexpected end of document
In the interest of brevity, I've not included the original xml, but it's just the standard weather xml from googles feed. I've also tried a few completely different xml files, (including the sample from http://www.ibm.com/developerworks/xml/library/x-android/) and they all give the same error. (They also all validate as well formed when I run them through an online xml validator). This makes me think that it's not a problem with the xml, but rather with how I'm trying to feed it into the parser.
View 2 Replies
View Related