1

I'm developing a simple apps for my own purpose using PhoneGap Build. For convenience, I'm pointing web browser, on each device where I want to install & test such app, to application download site on PhoneGap Build and download .apk files directly from there.

It works like a charm on every device, that has original system (i.e. first Galaxy Tab, first Google Nexus etc.). When I'm trying to do the same on my old LG GT540, which has non-standard Cyanogen Mod 7 ROM, download process fails. I don't get any extra information, only download manager adds status bar notification, that download failed and I can try to restart it, by touching that notification (no effect).

This is first time I run into such situation. I've heard many times about many factors that could prevent installation of .apk file, but never about not being able to download it.

My Internet connection is just fine, and this is related to .apk files only. I can download any other file types using web browser. I can also install .apk files manually, once I deliver them by cable to phohe.

Has anyone else got similar experience or know, what is going on here?

trejder
  • 2,537
  • 6
  • 39
  • 69
  • 2
    Did you look for information in the logcat on that device? – Dan Hulme May 28 '13 at 22:38
  • 1
    Could it be blocked from downloading apks out of security aspect? – t0mm13b May 28 '13 at 22:55
  • 1
    Maybe a secure connection with a self-signed certificate? That might be handled differently by different browsers. But without any more details (e.g. logcat, as Dan already suggested), it's hard to tell. Have you tried with a different browser? – Izzy May 28 '13 at 22:56
  • @Dan: I'm a very basic user of Cyanogen mod (using only on this one device) and a complete newbie, as it comes to testing, debug, jailbreaking, system stuff. So, unfortunately, I got no idea, how to use logcat on Android and/or access its logs. :| – trejder May 29 '13 at 07:08
  • @Izzy: This is a very old phone with a very poor performance and I fear that anything except system default browser will simply not work. But you're most certainly right -- I should test this issue on at least Opera Mini before posting sorry. Will do it soon and post some results here. – trejder May 29 '13 at 07:09
  • 1
    If you're trying to write an app, even with PhoneGap, you need to know how to look at the logs. It's an important tool for debugging problems. The logs for the web server you're trying to download from would be useful too, to rule out the possibility that it's treating the CM device differently. – Dan Hulme May 29 '13 at 07:30
  • 1
    Easiest way to take a look at logcat is using a logcat app (being on CM7/Android 2.3, there should be no issues with them). Another way is using adb logcat (see Is there a minimal installation of ADB? for a simple way to get that working)). – Izzy May 29 '13 at 07:42
  • @DanHulme: I'm building a very easy mobile apps, purely in HTML 5 & CSS via PhoneGap Build. I don't even have local PhoneGap installed, so I don't think I need logcat in this case! :] I assume, that as along as master WebView application, added by PhoneGap Build, to surround my HTML 5 & CSS code, works fine, I won't get any extra information from logcat about problems with my app. I agree, that it would be necessary, when developing PhoneGap apps with local / manual build, Java plugins etc. But in this case? – trejder May 29 '13 at 12:32
  • @Izzy: Though I have CM7/Android 2.3, I did not found logcat icon in my app drawer. But following link you provided, I managed to install Windows version of ADB and with logcat window on-board it I managed to catch a warning, that I have /mnt/sdcard/download/ folder missing (some funny app, not me, renamed it to /mnt/sdcard/Download/ with capital D in the beginning). After fixing this (renaming folder back to /mnt/sdcard/download/), downloading problem is gone. Please, put this as formal answer, so I can accept it. – trejder May 29 '13 at 12:36
  • @trejder I didn't say such an app comes pre-installed with CM -- instead I provided you with a search-link on good candidates -- little misunderstanding :) Glad you were able to solve (or rather "work-around") the issue. As requested, I summed up an answer below, containing additional background information. – Izzy May 29 '13 at 13:16
  • @Izzy: Just a small addition: Since we're talking about two years old, pretty much worn-off, poor performance LG GT540, I'm even happy, that I misunderstood you and not installed any logcat-related app on this phone. Looking at external program (QtADB) and how many data logcat can collect per second, I'm pretty sure, this could kill-up that old boy, LG, when I would try to read logcat logs on-line, directly on mobile phone! :] – trejder May 29 '13 at 21:37
  • I doubt that. Understanding logcat: it uses a circular buffer, size is defined by ROM-cook (most likely pretty small on yours). My good old Wildfire had no trouble with aLogCat ever :) But nevermind: Having discovered QtADB, guess you found some additional things to be happy about :D – Izzy May 29 '13 at 22:08

1 Answers1

1

Summing up the solution from above comments on the question itself:

Finding the culprit

First step is to get to the logging information on your device, to figure out some more details on what's going on. Multiple choices to do so:

  • get a logcat app from the Playstore. There are many, and as long as you run Android 4.0 or below, none of them have issues. Starting with Android 4.1, apps can only see their own log entries (so a logcat app only sees what it writes itself, which makes it quite useless) -- unless your device is rooted (your CM7 is), and you convert the logcat app into a system app (which can be done e.g. using Titanium Backup ★ root). To find a suiting logcat app, simply use this playstore search -- AFAIK none of them comes pre-installed with CM.
  • get it done from your PC. See Is there a minimal installation of ADB? for how to get ADB installed on your Linux/Mac/Windows computer, and how to set up its configuration so it recognizes your Android device. Then either use adb logcat from the , or a graphical interface (e.g. QtADB, as described in the linked question)

Solving the issue

As you followed above device, you were able to pick the corresponding error message from the logs: the app was looking for a folder named /mnt/sdcard/download/, which did not exist -- instead there already existed /mnt/sdcard/Download/ with a capital D. The problem behind this little thing is: While the underlying (FAT) supports mixed-case file/directory names, it does not differentiate correctly: cd download doesn't work due to different spelling, but mkdir download conflicts, though. So the solution, in your case, was to rename the existing Download directory to download.

While I still hold this as a bug in the apps used (they should be able to work around the issue, at least by asking the user where to download to), this simple trick at least enables you to download the .apk files now :)

Izzy
  • 91,166
  • 73
  • 343
  • 943