Showing posts with label phone. Show all posts
Showing posts with label phone. Show all posts

Sunday, May 24, 2015

Moto G OTA update error


If you get an OTA (over-the-air) update for your Moto G and it fails, here's what you can do. First, a few requirements:

  • A Moto G. This may work with the Moto E or X as well. YMMV.
  • Retail Android. This goes without saying, but you won't get an OTA update unless you're running one of the stock/retail ROMs.
  • Your phone has been rooted or otherwise customized (custom boot logo, custom recovery, etc). This isn't a strict requirement, but it's probably the reason the update is failing in the first place.
  • These instructions were written for Linux, but they should run with minor adjustments on Mac and a few not-so-minor adjustments on Windows.
There are two main ways to go about resolving this:

Method 1: recommended
This method is the easiest and probably the fastest:
  1. (Recommended) Back up your phone in case something goes wrong

  2. Get the model number for your phone
    Settings → About phone → Hardware SKU

    Or:

  3. Get the build number for your phone
    SettingsAbout phoneBuild number

  4. Download the retail firmware for your phone corresponding to the phone's model and build numbers. You can download them from here:
    http://www.filefactory.com/folder/c6cdedc45a775d27

    For me, I had the Moto G XT1034 with build number KXB21.14-L1.61, so I downloaded this file:
    AWSRETAIL_XT1034_4.4.4_KXB21.14-L1.61_cid9_CFC.xml.zip

  5. Once the retail firmware has finished downloading, extract it

  6. Install the Android SDK tools

  7. Put your phone into fastboot mode. To do so, power off the phone, press and hold the volume down button, press power button, hold both for about 3 seconds and then let go

  8. Go to the folder where you extracted the retail firmware. Now we're going to restore the stock firmware without erasing the data partition (where all of your apps, settings, etc are stored):

    sudo fastboot flash boot boot.img
    sudo fastboot flash recovery recovery.img
    for file in system.img_sparsechunk.*; do sudo fastboot flash system $file; done
    sudo fastboot reboot


    If you're using Windows, you'll have to flash the system.img_sparsechunk files on at a time, for example:

    fastboot flash system system.img_sparsechunk.0
    fastboot flash system system.img_sparsechunk.1


    ... and so on.

  9. Now try the update again
    SettingsAbout phone → System updates

  10. If the update fails again, you have one of two options. If you don't mind wiping your phone and starting from scratch (which will erase everything), the easiest thing to do is to do fully restore the stock firmware. You'll put your phone into fastboot mode as before, but this time you're going to overwrite everything:

    sudo fastboot flash partition gpt.bin
    sudo fastboot flash motoboot motoboot.img
    sudo fastboot flash logo logo.bin
    sudo fastboot flash boot boot.img
    sudo fastboot flash bootloader bootloader.img
    sudo fastboot flash recovery recovery.img
    for file in system.img_sparsechunk.*; do sudo fastboot flash system $file; done
    sudo fastboot flash modem NON-HLOS.bin
    sudo fastboot erase modemst1
    sudo fastboot erase modemst2
    sudo fastboot flash fsg fsg.mbn
    sudo fastboot erase cache
    sudo fastboot erase userdata
    sudo fastboot reboot


    If, however, you don't want to completely wipe your phone and you don't mind getting your hands dirty, read on.

Method 2: advanced
  1. At a minimum, you will need to make sure the stock recovery is flashed. Follow the instructions above, flashing only the recovery:

    sudo fastboot flash recovery recovery.img
    sudo fastboot reboot

  2. Now try to apply the OTA update. If it fails, now the fun begins! First of all, if your phone isn't rooted, you'll need to root it to get access to the update log files. If you flash a custom recovery to root, then flash the stock recovery back (the OTA will fail with a custom recovery).

  3. Once your phone is rooted, connect to it using adb and look at the update log, which will be located in /cache/recovery/last_log

    adb shell
    su
    more last_log

  4. Look particularly at the end of the log file to see what went wrong. This is what mine said:

    script aborted: "/system/etc/install-recovery.sh" has unexpected contents.
    "/system/etc/install-recovery.sh" has unexpected contents.
    E:Error in /cache/Blur_Version.210.12.61.falcon_umts.AWSRetail.en.US.zip
    (Status 7)
    Installation aborted.


    You can see that apparently the file /system/etc/install-recovery.sh had been modified, probably from when I rooted the phone.

  5. If the file causing errors is in this list:
    • /system/bin/app_process32
    • /system/bin/app_process64
    • /system/bin/install-recovery.sh
    • /system/etc/install-recovery.sh

    • Then the problem is SuperSU itself, which modifies a bunch of files when it's installed. You'll need to restore the files from backup:

      cp /system/bin/app_process32_original /system/bin/app_process32
      cp /system/bin/app_process64_original /system/bin/app_process64
      cp /system/bin/install-recovery_original.sh /system/bin/install-recovery.sh
      cp /system/etc/install-recovery_original.sh /system/etc/install-recovery.sh

  6. If another file has been modified, you need to replace the original file. This will take some work. First, you'll need a special utility called simg2img. You can probably find a pre-built binary for your system. I just compiled it myself:

    sudo apt-get -y install build-essential git zlib1g-dev
    git clone https://android.googlesource.com/platform/system/core
    cd core/libsparse
    gcc -o simg2img -Iinclude simg2img.c sparse_crc32.c backed_block.c output_file.c sparse.c sparse_err.c sparse_read.c -lz
    sudo cp simg2img /usr/local/bin

  7. Go to the folder where you extracted the retail firmware, and you should have one or more files starting with system.img_sparsechunk. The next step is to combine them using simg2img:

    simg2img system.img_sparsechunk* system.raw.img.tmp

  8. Now we're going to extract the ext4 partition from the image file we made:

    offset=`LANG=C grep -aobP -m1 '\x53\xEF' system.raw.img.tmp | head -1 | awk '{print $1 - 1080}'`
    dd if=system.raw.img.tmp of=system.raw.img ibs=$offset skip=1

  9. Getting close! Now, we'll mount the image we just created:

    sudo mkdir /mnt/system
    sudo mount system.raw.img /mnt/system

  10. Now we should have access to all of the original files from the retail firmware. The next step is to copy them to the device. Here's what I did to copy /system/etc/install-recovery.sh:

    adb push /mnt/system/etc/install-recovery.sh /sdcard/

  11. Now connect to the device and get the mount point for the /system partition:

    adb shell
    mount | grep system

  12. Finally, remount /system as read-write, copy the file, and then remount /system as read-only. Don't forget to replace the mountpoints in my example (/dev/block/platform/msm_sdcc.1/by-name/system) with the mountpoint you got from the previous step:

    mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
    cp /sdcard/install-recovery.sh /system/etc/install-recovery.sh
    mount -o ro,remount /dev/block/platform/msm_sdcc.1/by-name/system /system

  13. If you've made it this far, congratulations! Try the update again. Hopefully, as in my case, it will now work. If not, you'll have to look at the update log file again and see if there's anything else you missed. Thankfully it'll go much quicker now that you've already done all the prep work.

Saturday, October 25, 2014

HERE Maps: The best free map/navigation app


I've long been an advocate of phone apps that work with no internet connection. When it comes to map/navigation apps, there are several important reasons for offline use:
  1. Like myself, there are people who—gasp—don't have a data plan on their phone
  2. Others have limited data plans, and map apps can use a lot of data
  3. Even for those with unlimited data plans, there are still many places where cellular coverage is bad or even nonexistent
  4. Lastly, it's really nice to have if you travel outside of your country and have no cellular service
Unfortunately, the most popular maps app—Google Maps—is terrible when it comes to offline use:
  1. You can download portions of maps for offline use, but the size of the area you can download is limited (you can't download an entire US state, for instance)
  2. Navigation doesn't work offline at all
  3. When offline you won't see any place names like businesses, parks, etc.
There are some free map apps out there that can be used offline, but they have limited capabilities and often ads. So that means if you want offline use, your best option is to pay for an expensive premium maps app.

But as of this week, there's a premium maps app that works offline, and it's free! I give you: HERE Maps.

HERE Maps has actually been around for a long time under other names (NAVTEQ/Ovi Maps/Nokia Maps). They're actually one of only four big map sources (the others being Google, OpenStreetMap, and TomTom), and they license their maps to many others, like Garmin and Yahoo.

Here are some of the features that HERE Maps offers:
  • Download countries and regions ahead of time for offline use
  • Maps in nearly 200 countries, and turn-by-turn navigation in nearly 100 countries
  • Full street addresses
  • Alternate routes
  • Points of interest
  • Traffic
  • Public transit
  • Speed limits
Ready to try it? Go here to read how to get it and install it:
HERE for Android unleashed on more smartphones!

Once you've got it installed, here are some great tips for getting started:
Getting started with HERE for Android: the basics

If you have an iPhone, HERE Maps should be available for you before the end of 2014.

Saturday, October 11, 2014

The Moto G one year on


I've never owned a brand-new smartphone. For those like me who opt for contract-free, inexpensive phone service, buying a new smartphone is cost prohibitive when the carrier isn't subsidizing the price in order to lock you in to a contract with a high monthly rate.

A little under a year ago, Motorola changed that when they announced the Moto G. Even before I bought one for a family member, I could tell it was the phone I'd been waiting for for a long time. No bells, no whistles, just things I cared about: performance, durability, battery life, and up-to-date software. All this at a price that meant someone like me could actually afford a brand-new smartphone that was actually worth buying.

Since that time, at my recommendation, a handful of friends and family members have also bought the Moto G, and they've all been quite happy. It lived up to my expectations, and continues to do so. Here are my impressions almost a year on:
  • Motorola has kept their word, and up to this point the Moto G is still running the latest version of Android
  • It's lightning fast, especially with ART enabled
  • The battery life is incredible, often going 2-3 days in between charges (with data off, which helps)
  • The price to this day remains competitive, and I've seen it sell for as little as $50 through carriers
  • It's quite durable, and I haven't had any need to take advantage of the included one-year warranty
  • Motorola has gone above and beyond by periodically providing fun boot animations
In case you're considering picking one up, there are currently 3 models:
  • First-generation Moto G
    • The original. This is the model that most carriers are selling. Unfortunately they're also mostly selling the 8 GB model, which isn't much storage. I would only recommend this one if your priority is saving money, or if you're sure you won't need the extra storage.
  • Moto G 4G
    • Released in June, identical to the first-gen Moto G but with an added SD card slot and LTE. This is the model I recommend for those that want to be able to use their phone with one hand.
  • Second-generation Moto G
    • Just released, the camera is upgraded, the speaker is moved to the front, an SD card slot is added, and the screen size is increased to 5 inches. I'd recommend this model to anyone who wants a big screen and doesn't necessarily need to use it with one hand.

Friday, March 28, 2014

Free wifi/data calls on your smartphone, part 2


(Pour le français, allez ici : Les appels de données/wifi gratuits sur votre smartphone, partie 2)

I blogged a long time ago about making free wifi/data calls on your smartphone. Since then, there are thankfully a few easier and better ways to do this:

Google Hangouts/Google Voice

My method of choice involves Google's Hangouts/Voice service. Google Voice was the old name for Google's service that could be used to send and receive free phone calls and send text messages (to the US and Canada), and they're currently rolling it into their Google Hangouts service that does that and more. Even if you don't use Gmail, most everyone has a Google account already, so you probably don't need to sign up for anything extra.

If you're using iOS (iPhone or iPad), it's easy. All you need to do is download the Google Hangouts app: Google Hangouts for iOS.

If you're using an Android device, by May 15th (2014) you should also be able to use the Google Hangouts for Android app to make free calls and texts. In the meantime, though, there are a few other solutions that work just as well:

  • GrooVe IP Lite
    This is the app I ended up using. It's free, works great, and has some settings that let you customize things. In addition, it only handles calls and texts and not Hangouts chats or video calls, so it doesn't interfere with the Hangouts app.

  • Mo+ PHONE for Google Voice
    This app has a nice, clean interface and easy setup. Unfortunately, it had several drawbacks that led me to uninstall it:
    • As soon as I logged in, I started getting all kinds of requests to chat from complete random strangers.
    • This app also handles Hangouts chats, which for some might be a plus, but for me was annoying because they would come in through this app and Hangouts. It wouldn't be so bad if I could have disabled Hangouts functionality in the app, but it has absolutely no settings to configure.
    • The final nail in the coffin is when I tried to actually use it to make a call. The quality wasn't as good as Groove IP Lite, and there was a frustrating lag of several seconds.

  • Talkatone
    This app doesn't work in Canada, so it was an immediate no-go for me. Maybe you'll have better luck.

  • Spare Phone
    This app costs $3, which by itself isn't a bad thing, but it hasn't been updated since June 2013, and I don't see any compelling ways it sets itself apart from the others and merits paying $3 for.

Other ways

Not into Google? Well, there's something for everyone. There is one other app I found that offers free calling and texting to the US and Canada: Mo+. Yes, they're the same ones that also offer an app for free calls through Google Hangouts that I wasn't so happy with. But this one is based on their own service. I haven't bothered using it since I'm happy with Groove IP, but some people might prefer it:
There are other apps out there like TextNow and TextPlus that are similar, but as far as I can tell none of them offer free outgoing calls.


Well, that wraps it up for now. This is one area that's rapidly changing, so I'm sure I'll be blogging about it more in the future. Until then, enjoy making free phone calls!

Les appels de données/wifi gratuits sur votre smartphone, partie 2


(Go here to read this post in English: Free wifi/data calls on your smartphone, part 2)

J'ai blogué il y a longtemps sur les appels de données/wifi gratuits sur votre smartphone. Depuis ce temps-là, il y a heureusement quelques moyens plus faciles et meilleures pour le faire :

Google Hangouts/Google Voice

Ma méthode de choix est le service Google Hangouts/Voice. Google Voice est l'ancien nom pour le service de Google qui pourrait être utilisé pour envoyer et recevoir des appels téléphoniques gratuits et envoyer des messages texte (aux États-Unis et Canada), et ils sont actuellement en train de le combiner avec leur service Google Hangouts qui fait ça et plus encore. Même si on n'utilise pas Gmail, presque tout le monde a déjà un compte Google, donc on probablement n'a pas besoin de s'inscrire pour quelque chose de plus.

Si on utilise iOS (iPhone ou iPad), c'est facile ; tout ce qu'on doit faire est de télécharger l'appli Google Hangouts : Google Hangouts pour iOS.

Si on utilise un appareil Android, le 15 mai (2014), on devrait également pouvoir utiliser l'appli Google Hangouts pour Android pour faire des appels et textes gratuits. En attendant, cependant, il y a quelques autres solutions qui fonctionnent tout aussi bien :

  • Groove IP Lite
    C'est l'appli qu j'ai fini par utiliser. C'est gratuit, fonctionne très bien, et a quelques paramètres qui permettent à personnaliser les choses. En outre, il gère seulement les appels et les textes et pas les chats ou appels vidéo de Hangouts, donc il n'interfère pas avec l'application Hangouts.

  • Mo+ Phone for Google Voice
    Cette appli a une belle interface claire et une installation facile. Malheureusement, il a eu plusieurs inconvénients qui m'ont amené à désinstaller :
    • Dès que je me suis connecté, j'ai commencé à recevoir toutes sortes de demandes de discuter des étrangers complets.
    • Cette application gère également Hangouts chats, qui pour certains pourrait être un plus, mais pour moi, c'était ennuyeux car ils viendraient à travers cette application et Hangouts en même temps. Il ne serait pas si mal si il y avait des paramètres avec qui j'aurais pu désactiver Hangouts, mais il n'y a absolument aucun paramètre à configurer dans l'appli.
    • Le dernier clou dans le cercueil, c'est quand j'ai essayé de l'utiliser pour faire un appel. La qualité n'était pas aussi bon que Groove IP Lite, et il y avait un décalage frustrant de plusieurs secondes.

  • Talkatone
    Cette appli ne fonctionne pas au Canada, et était immédiatement pas acceptable pour moi. Peut-être que vous aurez plus de chance.

  • Spare Phone
    Cette appli coûte 3 $, ce qui en soi n'est pas une mauvaise chose, mais il n'a pas été mis à jour depuis juin 2013, et je ne vois pas de manière convaincante comment il se distingue des autres et mérite de payer 3 $.

Autres moyens

Si on n'aime pas Google, il ya quelque chose pour tout le monde. Il ya une autre appli que j'ai trouvé qui offre des appels et SMS gratuits aux États-Unis et Canada : Mo+. Oui, ils sont les mêmes qui offrent également l'appli pour les appels gratuits via Google Hangouts avec que je n'étais pas si heureux. Mais cette appli-ci est basé sur leur propre service. Je n'ai pas pris la peine de l'utiliser puisque que je suis heureux avec Groove IP, mais certaines personnes pourraient préférer :

Il existe d'autres applis comme TextNow et TextPlus qui sont similaires, mais pour autant que je sache aucun d'entre eux offrent des appels sortants gratuits.


Eh bien, c'est ça pour le moment. C'est un domaine qui change rapidement, donc je suis sûr que je vais bloguer à ce sujet plus à l'avenir. En attendant, profitez de faire des appels gratuits!

Monday, December 9, 2013

Speed up a slow Android phone


Your Android smartphone/device is a computer. Like most computers, it can get slow after a while and benefit from a periodic cleanup. Here are some things you can do to speed up your Android phone if it's acting slow:

  1. Reboot
    Maybe this is obvious, but if you haven't powered off your phone in a while, go ahead and reboot it (or power it off and back on again).

  2. (Nexus and HTC One phones only) Try LagFix
    This only applies if you have a Nexus or HTC One phone and running Android less than 4.3. These devices have a very specific bug that causes lag and can be fixed by this app: LagFix (fstrim) Free (requires root). I wouldn't recommend running this for other phones; at best it will do nothing and at worst it could damage your phone.

  3. Undo any recent changes
    If your phone has only recently been acting slow, think about any recent changes you've made. Have you recently installed or updated certain apps? Have you recently received a software update? Any of these changes can slow your phone down. If it's an updated app, you can sometimes find old versions of apps online. If it's a software update, undoing it will be much trickier, but it is possible. If it is indeed the culprit, somebody's probably written up instructions on how to go back to the previous software version.

  4. Uninstall/disable unused apps
    Some apps actually run in the background whether or not you've opened them. Too many of these kinds of apps will definitely slow down your phone. Examples of apps that run in the background are apps that display notifications, whether notifications that are always present or notifications that show up from time to time. Aside from these, we could certainly all benefit from going through our apps from time to time and removing any we don't use any more.

    Some phones come with a lot of preinstalled apps that you don't use or want (called bloatware). These often can't be uninstalled, but they can be disabled starting in Android 4, which should at least keep them from slowing down your phone. To disable them go to Home  Menu System settings Application manager  All, select the app to disable, and click Disable.

  5. Greenify!
    I intentionally put this step after the previous step, because the first step really is to get rid of apps you're not using. But of course there are certainly some apps that you'll want to keep, and what if one of those is the culprit, running in the background and slowing your phone down? Thankfully there's a great solution: Greenify. It's an app that lets you control which apps run in the background. It doesn't kill them, but it hibernates them instead. Because of this, it does need root access.

    Side note: I mentioned that Greenify doesn't kill apps running in the background. This is because 
    killing apps can actually slow your phone down and use up your battery faster because then the apps will just start themselves back up. If you're using a task killer app thinking you're speeding your phone up or saving battery life, you're probably doing just the opposite. You should uninstall it right away, and instead follow the steps in this post if you're having issues.

  6. Remove some widgets
    Building on the previous point, there's a whole category of software that runs in the background: widgets. Any widget you have on your home screen is going to run in the background on your phone all the time. The more you have, the slower your phone can get. Remove a few and you may notice your phone runs faster.

  7. Don't use live wallpaper
    Live wallpaper is fun, but it's just creating extra work for your phone and using up your battery faster. Use regular wallpaper instead.

  8. Look at your SD card
    If your phone has a removable SD card, turn it off and remove it. See if that fixes the problem. If so, see what the speed class of the card is. If it's less than class 6, I'd recommend buying at least a class 6 card, especially if you've moved any of your apps to the SD card. If your phone has internal storage, which most recent phones do, you could even try running without the SD card. At the very least go through your SD card and clean up some of the unused files and folders. Apps have an annoying habit of putting things on there and not cleaning them up.

  9. Clear app cache
    Clearing the caches for your apps may help speed things up. If your phone is rooted and Titanium Backup is installed:
    1. Open Titanium Backup
    2. Go to MenuBatch actions
    3. Scroll down to Manipulate data → Clear cache for user & system apps and click RUN
    4. Click Select all and then click the green check mark in the upper right to begin the task

    If your phone isn't rooted and/or you don't have Titanium Backup installed, the process is a lot more tedious:
    1. On your phone, go to Home  Menu System settings Application manager  All
    2. For each application in the list, select it and click Clear cache. Yes, I told you it would be tedious. This should be good incentive to follow my previous suggestion at getting rid of unused apps :)

  10. Wipe cache partition
    This will probably only be available to you if you've rooted your phone. If you have, power it off, boot into recovery mode (varies by phone), and select the option to wipe the cache partition.

  11. Disable/uninstall apps one by one
    I've saved this one towards the end because it's going to be pretty tedious. If you've made it this far and your phone is still inexplicably slow, you can try disabling or uninstalling apps one by one and seeing if that changes anything.

  12. Factory restore
    I wouldn't recommend doing this more than once a year, because you're going to have to set your phone up from scratch after doing it, but just like formatting your computer and reinstalling everything, a factory restore can help speed up your phone. First, back everything up (I recommend rooting it and using Titanium Backup). Once you've backed everything up, you can do the factory restore by going to Home  Menu System settings  Backup and reset  Factory data reset (specific location varies by device). Again, in case you weren't paying attention, this will erase everything on your phone, so make sure you've backed up everything that's important first.

  13. Downgrade Android
    Sometimes the device manufacturers release software updates that end up making the phone slower. The solution in this case is to downgrade Android. This is not a trivial task, and will vary by device, so you'll have to Google this one. Honestly if you get to this point, you may just be better off buying a Moto G.



Monday, July 8, 2013

An open letter to Android smartphone manufacturers














Dear Android smartphone manufacturers,

Android's got a bad rap, and it's your fault.  You have built some really amazing phones, but you've also built a ton of really crummy ones, and quite frankly, we don't want to buy them.  Your focus is all wrong.  But I have some suggestions:
  1. Battery life
    If we have to charge our phones more than once a day, we're going to be dissatisfied, period.  This doesn't mean it should be able to play HD video for 24 hours, but a modern smartphone should be able to handle moderate use without having to be charged more than once a day.

  2. Stock Android
    When is the last time you heard someone say how much they love HTC Sense (HTC's customized version of Android), or Samsung's TouchWiz?  Don't even get me started on Motorola's Motoblur.  The answer is never.

  3. Smaller screen sizes
    We want phones we can use with one hand.  I think the ideal phone screen size is somewhere between 4 inches (iPhone 5) and 4.3 inches (Galaxy S2).  I have the latter, and it's big enough that I can't reach the opposite top corner of the screen without shifting the phone in my hand.  I definitely wouldn't want anything bigger.  And guess what?  Smaller screens use less battery!  It's win-win.

  4. Fewer models
    Don't build 100 different phones.  The real competition is Apple, which builds just one phone a year.  No need to go that extreme, but make just 2 or 3 models, and don't bother building a "low-end" phone; the profit margins are going to be too low and it will just muddy your brand.  Also, only release new phones once a year.  Releasing a new phone every month only devalues the high-end phone that you just released.  Plus it frees up resources to make sure your phones are stable, and so you can actually push out the latest versions of Android to your customers, which is a huge complaint among Android owners.

  5. No gimmicks
    Why would you dare add some completely unnecessary feature to a phone if we never asked for it, it's going to make the phone cost more, and/or it's going to decrease battery life?  Here are just a few gimmicks we don't care about, off the top of my head:
  6. Durability
    If you want to throw in features, give us a feature that will benefit us, like a phone that's water resistant or isn't going to completely shatter when dropped from a short height.

  7. Less bloatware
    No, I don't want Slacker Radio, UNO, a crippled GPS navigator, or some trial office suite.  I know a lot of this is dictated by the carriers, but I feel like the manufacturers don't try very hard either.
Want to differentiate yourself?  Build a solid phone, with no gimmicks, and stock Android.  That'll be enough differentiation.  If you really want to shake things up, build some cool apps.  S Health, for instance, has been a huge hit with Samsung users.

Tuesday, August 28, 2012

Android: can't upgrade read-only database from version 0 to 1

Solution:

If you have named one of your SQLite tables "default", change the name to something else.

Details:

So I was poking around with Android programming the other day, and I ran into this error:

04-12 14:35:09.779: ERROR/AndroidRuntime(790): Caused by: android.database.sqlite.SQLiteException: Can't upgrade read-only database from version 0 to 1: /data/data/com.example.test/databases/mydatabase.db
04-12 14:35:09.779: ERROR/AndroidRuntime(790): at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:170)


The line causing the error was simply calling SQLiteOpenHelper.getReadableDatabase():

SQLiteDatabase db = dbHelper.getReadableDatabase();

I finally narrowed it down to the database table name I was using: "default". As soon as I changed the table name, it worked fine. In fact, I simply changed it from "default" to "default1".

Just to be clear, I wasn't doing anything fancy. I was using pretty basic code to create the database:

public class DatabaseHelper extends SQLiteOpenHelper {
    public static final String DB_TABLE_NAME = "default";
    ...
    public static final String DB_TABLE_CREATE =
        "CREATE TABLE " + DB_TABLE_NAME...


It doesn't appear to be a SQLite thing, because according to their documentation the only reserved table names begin with "sqlite_". So it appears to be an Android issue, and as far as I can tell it isn't documented.

I checked the database after I changed the name, and the "default" table was never created either, so I'm not sure why it wouldn't work:

sqlite> .tables
android_metadata default1


A bug, perhaps?

Wednesday, August 15, 2012

Cross-platform mobile development: PhoneGap + Enyo



If you want to develop a mobile application, but don't want to have to rewrite it for every platform you want to develop for (Android, iOS, etc.), PhoneGap is what you want. It allows you to develop applications using web technologies (HTML, CSS, JavaScript), and then deploy them to a large number of platforms, such as Android and iOS. It has APIs that let you interface directly with the mobile device's hardware (camera, GPS, accelerometer, you name it). It's even been approved by Apple, and we all know what a feat that is ;)

Undoubtedly you'll want a nice framework that gives you all the UI widgets you're used to: layouts, spinners, popups, progress bars, etc. That's where Enyo comes in. Enyo was actually the JavaScript framework that was part of WebOS. Since WebOS has been open-sourced, so has Enyo. I would recommend Enyo over other JavaScript frameworks like jQuery Mobile and Sencha; see here for some reasons why: Enyo+PhoneGap Vs jQueryMobile+PhoneGap

There are already some apps out there using this approach. Here are a couple for android:
I've even done some playing around with phonegap and the enyo samples myself. I put it in github in case it's of any interest:
https://github.com/bmaupin/junkpile/tree/master/java/testing/android-phonegap-enyo-test

The screenshots in this post are from that code, and you can see more here:
https://github.com/bmaupin/junkpile/tree/master/java/testing/android-phonegap-enyo-test/screenshots

Enjoy!

Thursday, June 14, 2012

android vs iphone/ios

I just read an incredibly well-written article from the point of view of a 4-year iphone user switching to android. if you're looking for an iphone (or android) bashing, move along. this is actually a balanced article that points out the pros and cons for both. very well done:

29 Days with Android

Thursday, December 1, 2011

more US wireless money-saving options

while doing research for my own clean break with verizon, I stumbled upon some great deals with various US wireless carriers that I thought I'd share with others out there who are looking to save some money:

  • simple mobile: $40 unlimited everything
    simple mobile's $40/month plan now includes unlimited 3G data. so that's unlimited talk, text, and 3G data for just $40 per line. that's nearly the cheapest deal you'll find anywhere in the US right now.


  • walmart family mobile: unlimited talk and text, free data for 3 months
    the first line is $45/month, so this isn't the cheapest plan for those who only need one line. but every line after that is just $25/month, so this can end up saving a lot of money if you need multiple lines.
    data is free for the first 3 months (for those who sign up before the end of 2011), and after that it's pay-as-you-go, which means this is also for those who need little or no data. note that the unlimited data offer doesn't include picture messaging, but each new activation gets 100M free data anyway, so the picture messaging will probably come out of that.


  • t-mobile: $30 unlimited text and data
    this one's kind of strange: you get unlimited data (the first 5 gigabytes are at 4G speeds, the rest will be slower) as well as unlimited texts, but you only get 100 minutes of talk. I suppose if you text and use the web a lot, but hardly talk, this would work for you. another possibility would be to use this with a service that lets you make free data calls, such as whistle phone.


  • virgin mobile: $35 unlimited text and data
    much like the t-mobile plan, this one gives you unlimited texts and data (the first 2.5 gigabytes at 3G speeds), but only 300 minutes of talk.


  • republic wireless: $20 unlimited everything
    yeah, you read it right. $20/month (technically $19) for unlimited talk, text, and data. there is a pretty big catch though: republic wireless enables prices like this by offloading your mobile traffic over wifi. what this means is if you do most of your cell phone usage (whether it be talking, texting, or web) within distance of a wifi signal you have access to (for instance at home and work), then republic wireless can save you a hefty amount of money. if you can't meet that requirement, however, I wouldn't recommend it. the best part is you get 30 days to change your mind and get your money back.




these plans all do require you to buy your phone up front, but with the money you'll save paying these kinds of rates (the most expensive plan mentioned here is $45/month), you'll be able to afford a nice phone. the best part (other than saving a lot of money, of course), is that all of these plans are contract-free. no more dealing with crummy customer service or paying more than you like because you're locked into a contract.

what are you waiting for? stop reading and go save some money!

Friday, November 4, 2011

saying goodbye to verizon :)

I cannot wait. in just a few weeks, I'll be saying goodbye to verizon wireless for good. I'm essentially following my own advice, starting at step 1 (don't renew your contract), and I couldn't be happier, for several reasons:

  1. Verizon (and the other major carriers) forces you to have a data plan if you have a smartphone.
    okay, so I thought they did this so they would get their money back on subsidized phones. wrong. they're just greedy. I say this because you can't even go out and buy a used smartphone on craig's list and put it on one of the major networks without having a data plan. you can feel free to try, but when you take a look at your next bill you'll have a nice new shiny data plan added.


  2. Verizon is CDMA-based
    I like to travel, and I'd like to be able to use my phone when I travel. Verizon uses a wireless standard (CDMA) that is limited to the United States and just a few other countries. if you use a provider that's based on GSM (the global standard), all you have to do is unlock your phone, which is cheap, and you can use your phone worldwide.


  3. last, but most certainly not least, price!!
    these plans are all based on 2 lines, with at least 1500 minutes and 500 texts per line. first up, the 4 major carriers:










































    carrierplanpriceminutestextdata
    at&tnation 1400 familytalk + family messaging unlimited$1301400unlimitednone
    verizonnation family shareplan 1400 + 500 messages/line$1101400500/linenone
    sprinteverything messaging family 1500$1001500unlimitednone
    t-mobileunlimited value - talk + text$80unlimitedunlimitednone

    these aren't even an option for me, because the major carriers all require contracts as well as a data plan with a smartphone. plus, Verizon and Sprint are CDMA-based.

    but thankfully those aren't my only options. there are many smaller carriers that don't require a contract, and use the same networks as the larger carriers, all at a fraction of the price. I won't include CDMA-based ones like MetroPCS, Cricket, Virgin, or Boost, but here are few GSM-based ones:

































    carrierplanpriceminutestextdata
    h2o wirelessh2o unlimited$80unlimitedunlimitednone
    simple mobileunlimited talk, text, and 3g web$80unlimitedunlimitedunlimited
    walmart family mobileunlimited talk & text$70unlimitedunlimitedunlimited for 3 months, pay-as-you-go after that



  4. it looks like the best deal is walmart mobile, but unlimited data with simple mobile for just an extra $10/month is mighty tempting...

    but just this week a new player has entered the mix that may blow all of the others out of the water. if the leaks are true, republic wireless will be offering unlimited talk, text, and data for a measly $19 a month. we'll just have to wait until Tuesday to find out...

Wednesday, October 19, 2011

Living with less (or no) data on Android

So I promised a little while back that I'd write up a post on some great Android apps that work offline. Of course many apps fall into this category, but these in particular are replacements for apps that otherwise normally rely on a data connection:

  • Aldiko
    I'm guessing most book reader apps will let you read books offline (once you've downloaded them), but this one is so good I haven't tried any others. I love it because it has a lot of public domain books for free, like many of the older classics.

  • CoPilot Live
    (link to USA version 8 )

    Did you know you can use your Android phone for GPS navigation even without a data connection? CoPilot Live is a full-featured GPS app that lets you download map data ahead of time so you can use your phone as a GPS offline. It's not perfect, and nowhere near as good as Google Navigation, but it's well worth the savings on an expensive monthly data plan.

    I'd recommend version 8 over version 9, mostly because the developers are using some pretty crummy bait-and-switch techniques and have split version 9 into "Standard" and "Premium" versions. The catch is the Standard version doesn't actually come with any features one might consider standard in a GPS app/device today, like 3D navigation, text-to-speech, and alternate routing. Let them know (via your wallet) that you think that's lame.

  • ESV Bible
    Many of the Bible apps out there require a data connection, and even when they let you download specific translations for offline use, it may not be the ones you want. If you're looking for a good, accurate, literal translation, the ESV is an excellent choice, and this app will do the trick.

  • Merriam-Webster Dictionary
    This is a full-featured English dictionary that works just great offline (except for a minor feature or two, like word-a-day). By full-featured I mean that it even lists example usage, origins, synonyms and antonyms.

  • GoMeals
    If you're watching what you eat, most calorie counting apps require a data connection to look anything up. While GoMeals is a little sluggish, it does contain the entire CalorieKing database, which is quite extensive.
Here are a couple more useful apps that better enable you to reduce your data consumption, particularly useful when you have a limited or pay-as-you-go data plan:

  • Onavo
    This is a really cool app that will let you monitor your data usage by app, and even limit or block specific apps. There are some other great apps out there that let you monitor your data usage, like My Data Manager Free, but this is the only one I've seen so far that lets you go the next step and block data usage for particular apps (at least the only one that doesn't require your phone to be rooted). The developers have stated that it's only free for a limited time, but it just may be worth paying for (provided it's not a recurring fee, which would defeat the purpose).

  • Widgetsoid
    This app lets you create customizable widgets that will let you toggle many settings, including your data connection, allowing you to turn off mobile data altogether when you don't need it.
Note that if you are connected to the internet, some of these apps will use some bandwidth for advertising. But the point is that they will work fine without a connection at all.
Feel free to add your own suggestions to those of us who refuse to allow the wireless providers to rob us of additional hundreds of dollars a year for mobile internet. And feel free to check out my previous post on saving money on your cell phone bill:

Thursday, September 15, 2011

How to reduce your cell phone bill

Note: while this article is mostly specific to US wireless providers and practices like subsidized phones, many of these tips could probably be applied anywhere.

  1. Don't renew your contract

    Saving money on your cell phone bill will take some time and research, and the last thing you want to do is get locked in again to your overpriced contract. You'll want to be especially on your guard against "deals" your wireless company may offer, such as the ability to get a new subsidized phone by renewing your contract as early as six month before it expires.

  2. Shop around

    Okay, maybe this sounds like common sense, but you'd be surprised at the number of people that renew their overpriced cell phone contract because they haven't taken the time to look around for a better deal. The carriers are taking advantage of this, particularly Verizon and AT&T, whose prices are, well, not very competitive (yes, I'm saying they're expensive ;)).

    This part will take some time. Here are some things you'll want to consider:

    1. Look at coverage maps

      Most major carriers in the US cover at least 95% of the population, but it never hurts to get an idea of how good your reception will be at work, home, etc.

    2. Consider what carrier your friends and family have

      You have to be careful with this one, because it could cause you to get locked in to an overpriced carrier because they offer free mobile-to-mobile and most of your friends and family have that carrier. Having said that, if most of the people you call are on a certain network, even if that network is overpriced (Verizon, AT&T), you still might be able to save money if you can get away with a plan with fewer anytime minutes due to free mobile-to-mobile calls.

  3. Don't leave out the small guys

    There are many smaller carriers out there who offer much better prices than the big guys like Verizon and AT&T. Some of them actually operate on the same networks as the larger carriers, and so you'll get the exact same coverage for a cheaper price. Here are a few examples:

    There are also other carriers that operate their own smaller networks, but have roaming deals with the bigger carriers, so once again you still get coverage areas comparable to the major carriers:
    One small thing: in the US I recommend GSM carriers (any carrier using T-Mobile or AT&T's networks, including T-Mobile and AT&T), because you can get their phones unlocked and use them if you switch GSM carriers. CDMA phones (used by everyone else) are much more limited. You'll also be able to use your GSM phone if you travel overseas.

    There's a more comprehensive list of US wireless companies that operate on the larger companies' networks here:
    http://en.wikipedia.org/wiki/List_of_US_MVNO

    Here's a similar list for Europe:
    http://en.wikipedia.org/wiki/List_of_mobile_network_operators_of_Europe

  4. Stay away from contracts

    This might seem tough considering all of the major carriers will try to push a contract on you, but if you can get on a plan without a contract, you can potentially save some money, for a couple reasons:

    • Freedom to change

      The fees carriers charge for breaking contracts are quite ridiculous and only getting higher, especially for smartphones. Most of the time breaking a contract isn't a viable option. If you're not on a contract, then you don't even have to worry about those fees. If you happen to see a better deal with another carrier, you have the freedom to make the switch right away and start saving money.

    • Lower monthly bills

      Many carriers, even some of the major ones (like T-Mobile) offer cheaper plans that are contract-free. The catch is you either have to buy a phone at the unsubsidized full price (which can be incredibly expensive), or provide your own phone, which brings us to the next point...

  5. Consider a used phone

    I know, I know, you're thinking, "Used!? Are you crazy?" That's why I said "consider." ;) If you're really serious about saving money on your cell phone bill long-term, buying a used cell phone can save you tons of money.  A brand new basic cell phone can cost you upwards of $200. For smartphones, prices easily go above $500. You can literally save hundreds of dollars buy buying a used phone.

    There are tons of them on ebay, but you can normally find a better deal on craigslist if you're willing to put in a little more work. There are plenty of folks out there who get new subsidized phones every year or two, and since they didn't pay much for them, they're willing to part with them for a relatively small amount.

    Just make sure that it's compatible with the carrier you picked earlier. Most of the small carriers will list what major carrier's phones they're compatible with. If you're not sure, just ask. Also, if you buy a GSM phone (AT&T, T-Mobile) and want to use it on another carrier, you may need to get it unlocked. If so, see here: Cheapest way to unlock GSM phones

    Maybe you're thinking that it's cheaper to just sign a contract and get a really nice phone really cheap, or even free. The thing is, you're not really getting a deal, in particular if you're buying a smartphone. Do the math: most carriers require you to have a data plan for your smartphone. Data plans average around $30 a month. Over two years, this means you're paying an extra $720 for that "free" or "cheap" smartphone of yours. Capiche?

    Which once again brings me to my next point...

  6. Can you live with less data?

    If you get a subsidized phone on a major carrier, you may not have much of a choice. but you may be able to choose a much cheaper data plan if you're willing to live with less data. Some of the smaller carriers mentioned earlier even offer pay-as-you-go data plans, or will even let you put a smartphone on their network with no data plan at all, provided of course you buy the phone up-front or provide your own (most major carriers won't let you put any smartphone on their network without a data plan. Just ask them).

    And think about it, do you really need unlimited data? You probably have wifi at home, and you probably have it at work. More and more coffee shops, restaurants, and other businesses are offering free wifi. The majority of the time you don't even need data.

    You might even be able to get rid of data altogether. Either way, there are plenty of alternative apps that don't require any data at all. This post isn't getting any shorter, so I'll post about those later. (Edit: you can see that post here: Living with less (or no) data on android).

  7. Trade your contract

    If you do happen to be locked in a contract, but want to switch to another wireless provider, your options aren't limited to waiting it out or canceling your contract. Most providers will let someone else take over your contract. If someone using the carrier you want also wants your carrier, you may be able to simply take over each other's contracts. There are several sites that help facilitate this, but I recommend Cell Escape because it's free.

Monday, August 15, 2011

Cheapest way to unlock GSM phones

Looking to unlock your GSM phone? One word: ebay.

Of course you should always shop around and do some googling, if for no other reason than the fact that some phones can be unlocked for free, in particular many nokia models:

Free Nokia Unlock Codes

But if you do end up having to pay, ebay can save you a lot of money. For instance, I recently unlocked a Motorola Defy using a code I bought off ebay for $8 by searching "motorola defy unlock code." By comparison, this is what some of the unlock sites charge for a code to unlock that same phone (I'm including ebay in this list in case people skip right to this part of the post):

ebay: $8
cellunlock.net: $15 ($30 before coupon code)
cellunlocker.net: $30
cheapunlocks.com: $20
gsmliberty.net: $25
unlockgenie.com: $30
unlockitnow.com: $30

I'll let you do the math ;)

Tuesday, May 10, 2011

let FCC know how you feel about AT&T/T-Mobile merger

as is most everything I post here, this isn't recent news, but the FCC has a comment filing system where you can let them know how you feel about the proposed acquisition of T-Mobile USA by AT&T. go here:

http://fjallfoss.fcc.gov/ecfs/hotdocket/list

and select proceeding number "11-65".

source: http://www.dslreports.com/shownews/FCC-Wants-Your-Thoughts-On-ATT-TMobile-Merger-114028

Thursday, March 24, 2011

AT&T to purchase T-Mobile; corporations: 1 consumers: 0

With the recently announced purchase of T-Mobile USA by AT&T, it's evident that the only winners are going to be AT&T and T-Mobile themselves.

There's nothing good in this for the consumers. T-Mobile is the cheapest out of the four major nationwide carriers in the US. They're definitely cheaper than AT&T. With them gone, US customers will be forced to pay higher rates. AT&T claims that by acquiring T-Mobile they can lower their costs, and supposedly (1) they're going to pass on some of that savings with the customers. Sure they will. When's the last time you heard of a major corporation lowering prices, unless it was forced to by competition? If they can get away with making more money, they're going to do everything in their power to do just that.

And that brings me to my next point: competition. With T-Mobile out of the picture, there's less competition. Somehow or another AT&T is actually claiming there's plenty of competition! (2) What a joke. It doesn't take a PhD in economics to realize that less corporations in a given market = less competition = higher prices.

To top it off, T-Mobile is one of the few US carriers (along with AT&T) using a GSM-based network. Most people probably don't care, but for those who travel and want to use their phone outside the country, the options are already limited, and will be even worse after the merger. So if you want a GSM carrier, guess who that leaves? AT&T. Not only will you have to put up with higher prices, but you'll have to put up with their silliness, like blocking non-Android market apps on Android phones.

Ultimately the consumers are the losers in this deal.


1 "AT&T has promised to spread some of that windfall around"
http://tech.fortune.cnn.com/2011/03/21/att-mobile-merger-brings-efficiencies-but-will-consumers-see-the-benefit

2 "'The U.S. wireless industry is one of the most fiercely competitive markets in the world and will remain so after this deal'"
http://tech.fortune.cnn.com/2011/03/20/att-mobile-and-verizon-is-sprint-third-place-in-a-two-man-race

Thursday, March 17, 2011

Make free wifi/data calls on your android device

Update: I've blogged more recently on better ways to do this, so you might want to head here instead:  Free wifi/data calls on your smartphone, part 2


Note: this will only allow you to make calls to US numbers, excluding Alaska and Hawaii, as that's all the Whistle Phone service supports. See the last paragraph of this post for alternative options.

  1. Go to whistlephone.com, download their software to your desktop, and register for a free account.

  2. Download the CSipSimple app from the android market
    Here's the QR code:
  3. Open CSipSimple, choose the integration you want, then click Add Account. Then scroll down to Generic wizards --> Advanced.

    • Account name: whatever you want

    • Caller ID: your whistle phone number

    • Server: proxy.whistlephone.com

    • Username: your whistle phone number

    • Password: your whistle phone account password

    • Use TCP: leave unchecked

    • Proxy: proxy.whistlephone.com
And that should be it. You can now make calls using your Android device's data connection (wifi, 3G, 4G). If you chose to integrate with the native dialer, just make sure to choose the whistle phone account you created. If not, just open up the CSipSimple app to make calls.

For outgoing calls, it seems to take a good while to connect (about 15 seconds), then you have to listen to 10-second ad. Incoming calls seem to go through pretty quickly, though, and neither you nor the calling party has to listen to any ads.

The CSipSimple app mentions lots of other SIP providers, so maybe one of them is free and has better connection times for outgoing calls (perhaps even ad-free), or will even allow you to call different countries for free, but I haven't checked any of the others out yet.

Update: since I posted this, Whistle Phone limited inbound and outbound calls to 20 minutes. you can read more about that here: https://www.whistlephone.com/naywa. also, I did take the time to look into the other US SIP providers mentioned in the CSipSimple app, and none of them allows you to make free calls except to users using their service. but if you do hear of a better SIP provider, let me know!