Android Emulator Nuggets

Installing Google Play

  • This worked very nicely minimally for Android v7.1.1 “with Google APIs”…
  • Need to launch emulator.exe with -writable-system -selinux permissive args
  • grab the version of OpenGapps you want
  • Basically follow this guide but stop at “Restarting and Creating another Image”
    • Then adb root & adb remount
    • and I found that I just needed to adb shell mkdir /system/priv-app/Phonesky & adb push Phonesky.apk /system/priv-app/Phonesky not the other priv-apps
  • and I also didn’t have to create a new image vs simply rebooting

Root

one time

  • Grab SuperSU Recovery Download and extract “su”
  • adb root & adb remount
  • adb push su /system/xbin/
  • adb shell chmod a+x /system/xbin/su

create .cmd script for each launch

  • {path}\emulator.exe -avd Nexus_9_API_25 -writable-system -selinux permissive
  • adb wait-for-device & adb root & adb remount & adb shell "su -ad &"
    • -ad stands for auto-daemon and just sounds cool…
    • i haven’t seen anybody set this up to where android automatically launches the su daemon)
  • then just go install SuperSU from the Play Store
    • DO NOT allow it to upgrade the su binary upon prompting… that always hung my virtual device after reboot
  • and lastly fire up a Root Checker from Play Store to make sure

Clipboard integration

  • Android Studio (as of v2.3) directly supports Windows <=> Emulator cliboard integration (ref)
  • ADB shell input text "sample text" is pretty handy too

Handy Links

  • Android Studio download… main tools:
    • SDK Manage
    • AVD Manager
    • Device Monitor – event log and GUI file explorer
  • Google Play APK Downloader
  • ChainFire’s “How To SU”
  • Windows AVD Folder where the runnable virtual machines sit: %UserProfile%.android\avd
    • HOWEVER Upon running Android Studio’s vs Visual Studio’s version of emulator.exe will manipulate the %UserProfile%.android\avd\hardware-qemu.ini to point the .img file paths to their folders
  • Android Studio puts everything here: %AppData%..\Local\Android\SDK
  • Visual Studio puts everything here: C:\Program Files (x86)\Android\android-sdk
    • \platform-tools\adb.exe
    • \tools\emulator.exe
    • \system-images\android-25\google_apis\x86_64\system.img, etc.
  • AStudio emulator.exe runs better NOT elevated
  • VStudio emulator.exe runs better ELEVATED
  • AStudio emulator.exe v2.5.2 looks like it creates “copy on write” system.img.qcow2 files instead of modifying system.img directly which means you can save that qcow2 file as backup or erase it to rollback to clean baseline
  • VStudio emulator.exe v2.5.5 looks like it modifies system.img directly
  • qemu-img.exe info file.qcow2 will show you what base .img it’s linked to (download qemu bundle)
  • Install Intel HAXM directly if SDK Manager is no cooperating

My full fidelity emulator launch script

(special TCC/LE batch syntax)

@echo off
SETLOCAL 

::call tk qemu-system-x86_64
start "Android Emulator" /inv /pgm "C:\Users\beej1\AppData\Local\Android\sdk\emulator\emulator.exe" -avd Nexus_9_API_25 -writable-system -selinux permissive
adb wait-for-device
adb root
adb remount
adb shell "su -ad &"

:pasteloop

echos Press any key when ready... to paste current clipboard to android^r
pause

set clipline=0
do forever
  set cliptxt=%@clip[%clipline%]%
  if "%cliptxt%" EQ "**EOC**" LEAVE
  adb shell input text '%cliptxt%'
  set clipline=%@inc[%clipline%]%
enddo 
goto pasteloop

KeePass + Cloud Storage = (near) Password Nirvana

Update 2015-09-27: Neato! In June of 2015 the author has applied a mod which allows for KeePassHttp to be served from somewhere other than localhost… there are security implications to be considered here but as long as you know how to cover your bases it opens some nice possibilities to have a single KeepPass instance provide password resolution to multiple clients… e.g. a VM guest, other machines in your home, etc. Not provided in ready to run plgx file yet but following the self compile instructions found in the readme was fairly trivial.

KeePass2 – Password management application

  • 10 years mature
  • Free
  • Windows, Linux, Mac, Android and iOS versions
  • DropBox compatible (Google Drive, etc)
  • Autofill browser plugins
  • Rich text area for notes (e.g. challenge phrases and other reminders)
  • Open source (.Net)

  • Mac (and Linux) can run the Windows.exe via Mono
  • Initially ran native KyPass Companion on the Mac side (~$8). Have since switched back to the free mainstream build (see below)

  • On Android phone using Keepass2Android (free) with solid results

  • Provides special keyboard which facilitates autofill

  • DropBox and other cloud drives well supported (synchronize)
  • Handy yet still secure Quick Unlock feature
  • Consider a good android lock screen as additional layer of protection

I’m glad I finally took the time.  I (forced 😉 my wife to run the Windows version on her desktop and we share the same database file with our financial, healthcare, etc logins. So either of us can get into whatever we need wherever we are. It gives me peace of mind that she would have ready access to those important things in case I was somehow unavailable (knock wood). If you’re putting up with some other convoluted hodge podge as I was, please give this general idea a shot by wading in slowly and see if it makes your life easier as it has for me.

 2013-01-01: My main password file was corrupted

and I couldn’t log in.

  • Turns out I had a wonky entry that kept growing upon subsequent saves. Maybe compression algorithm was backfiring or something like that.
  • The offending entry was under KeePassHttp which just stores the authorized connection for each particular browser, so it was a no brainer to kill and recreate.
  • My kdbx file had grown to 28MB! after deleting it was back down to a measly 16k.
  • KyPass Companion was doing the most recent suspect saves causing massive growth so I can’t help but wonder.

DropBox really shines

  • Thanks to DropBox’s inherent versioning I could readily fallback to a working copy
  • Dropbox also showed the disturbing progression in larger file sizes over short amount of time
  • as well as which client that was driving those suspect saves – KyPass on my Mac
  • really gotta hand it to that product team, top notch stuff

KyPass’s questionable involvement gave me a reason to give the mainline KeePass2 another look…

Banging KeePass2 for OS X into shape

  • Updated from current v2.23 build to the latest official v2.24 build by dropping the latest KeePass.exe from the Windows zip bundle into the Contents/MacOS folder. This is promising; hopefully to never suffer the envy of a more recent build.
  • Contents/MacOS is also where plugins like KeePassHttp.plgx should be dropped.
  • KeePassHttp is working just fine for me running under this mono version.
  • Make sure to disable “Show a notification when credentials are requested” under Tools > KeePassHttp Options. Otherwise both KeePass and browser would freeze upon every login page request.

Nice to have’s in KeePass not currently available in KyPass Companion:

  • Automatic save-on-change (via triggers facility)
  • Autoload of the MRU kdbx file upon launch
  • Synchronization

[SOLVED] Error: “The following plugin is incompatible with the current KeePass version”
(/user/{username}/.local/share/KeePass/PluginCache/{unique}/KeePassHttp.dll)

  • Running on Mac via mono, turns out lldb is somehow the process forked by mono which hosts the KeePassHttp listener on port 19455
  • In my situation this pesky error was apparently caused by a crashed orphan lldb holding onto the port and blocking subsequent launches of KeePassHttp
  • Simply “KILLALL lldb” from terminal to resolve

Debug notes:

  • mono>debug.txt -v /Applications/KeePass{version}/Contents/MacOS/keepass.exe
  • Noticed SocketException well into the KeePassHttp plugin’s constructors call stack and started to realize the error message was misleading
  • Xamarin Studio will debug the running instance:
  • First, enable debugger break on SocketException: Run > Exceptions > enter SocketException in the search
  • Run > Debug Application > browse to keepass.exe

  • Xamarin Studio will also reverse gen back to C# source (not that we need it in this case but it’s good to know for future) – just create a new project and add the assembly (DLL or EXE) as a reference and click into it to see the readable source conversion of all classes.

Loading Ice Cream Sandwich (ICS – Android v4.0) on Samsung Galaxy Tab 7.7 (P6800)

Links:

  1. ClockWorkMod (CWM) “Recovery” booter for our device – Direct link to binary
  2. The actual ICS ROM (file name – P6800XXLQ1_ICS_IT168.zip)
  3. MD5 Checker

Steps:

  1. Check model – First make sure you have the same exact model as me = GT-P6800… it will be on the back in small print at the bottom.
  2. Download the links
  3. Check ROM file – use MD5 Checker to confirm P6800XXLQ1_ICS_IT168.zip checks to 16A167C9 – 7B1B892D – BA6884AD – 36434CFE
  4. Install CWM – Follow link #1 for install instructions… they’re clear… don’t skim, follow them closely
  5. Backup – Boot into CWM menu and do the full backup of your current system.
  6. Install ICS – Follow link #2 instructions…
    1. *everything* could be wiped as a result, so make sure you know where to go reload all your apps!!
    2. follow steps closely
    3. one clarification “2) place on internal SD” basically means /sdcard/ on ours… you get to browse for it in CWM so it doesn’t really matter where.

The tab took forever to reboot back up from the glowing “SAMSUNG” boot logo after the install BUT IT WORKED!

I’ve had this running since 2012-08-18 and haven’t had a single glitch… this ROM is well in the bag 100% solid no-brainer by all accounts at this point. I hope to load CM10 JellyBean v4.1 or perhaps even CM10.1 v4.2 soon… the one thing that still hasn’t been fixed on those yet is HDMI out (as of 2012-12-18) … and I actually really like using mine as a Roku stand-in.

Good luck!

(Back to main GTab7.7 Post)

Samsung Galaxy Tab 7.7 (P6800)


(My previous go to device, the Samsung Q1 Ultra.  She served us well. 🙂 Have we come a long way in 5 short years???

Highlights:

  • 7.89mm (0.31 inch) thick – just amazing to hold
  • 345 grams (0.76 lb) – makes for a great eReader… the brushed Alu back is nicely grippy after your hand has warmed it up for few secs (our Kindle 3G is 247g, 8.5mm and eInk is definitely cool for reading but it’s not color, smaller screen, lower res, not touch and isn’t app-tastic. Kindle Fire is 413 g, 11.4mm.)
  • Super AMOLED Plus screen, 1280 x 800 res – very pleasing as everyone points out. But to be totally frank, I ride outdoors a lot, and these are really no better in direct sunlight than anything else LCD based… indoors or even in a casted shadow, the screen is very nice.
  • 1.4GHz – everything runs nice and peppy on Android 3.2
  • 3G – HSPA+
  • microSD – surprisingly, the 8.9, 10.1 sibling tabs do not support an SD card. The original 5” Note and Tab 2 10.1 & 7.0 do, however.
  • full HD video MPEG4, H.264 play very smooth… I’ve tried just a few, one MKV wouldn’t play audio, another would.
  • 5100mAh battery

Some rather obscure downsides I’ve noticed so far:

  • When USB connected to a PC gtab 7.7 does NOT mount as a mass storage device; It mounts as an MTP device. For one, we don’t get a Windows drive letter. Drag and drop from Windows Explorer is basically the same… but various sync tools only work with mass storage. This post indicates that Honeycomb’s mixing of filesystems in the system folder structure is what renders mass storage infeasible (to PC’s).
  • The microSD card natively mounts to /mnt/sdcard/extStorages/SdCard … there doesn’t appear to be an Android standard established so (some) apps don’t know where to find it.

[Update: 2012-12-18] Upgrading to Samsung OEM Ice Cream Sandwich Android v4.0

Recommended (and not) Accessories:
The Tablet 🙂
image
I got mine for $645.50 from Amazon Market Vendor “Transformersandgsmphones” … it shipped very fast and was a brand new unit. Caveat: From what I understand, units purchased through grey market like this will be difficult if not impossible to submit for any warranty claim.
AmazonBasics Stylus
image
  • $11 from Amazon
  • Highly reviewed
  • Soft tip seems bulbous at first but in actual tablet usage turns out to be very appropriate. Still, I think I would really like the pressure sensitive line thickness capability of the Note models’ smart pen.
SanDisk 64GB microSD card
image
  • class 6 but speedy enough
  • it actually works
  • 7.7 formats it as fat32/vfat by default… there are some tools for getting it mounted as NTFS, IFF you think you need >4GB files… I found the tools not working right away and think I’ll be fine on fat32.
  • Got mine for $119 @ Amazon but that price is dropping almost daily! hold out as long as you can!
RAM-Mounts Cradle
(RAM-HOL-TAB-SMU)
image

image
  • I love RAM-Mounts and this is the absolute *PERFECT* fit for the GTab 7.7 in scenarios like bicycle handlebars.
  • The middle sized cup is a very satisfying fit for the GTab 7.7.
  • It will work great with a rubber case or naked. The grip spring is very strong. I bounced along a VERY bumpy 8 hour bike ride recently and there is no way the tablet is coming loose.
  • $28 from GPSCity
  • For bike handlebars I recommend pairing the cradle with this RAM kit comprised of a “strap rail base”, medium arm and diamond plate.
  • DSC_5916-50%-1530x1701
Sea to Summit Waterproof TPU Case
image
image
  • Make sure you get the LARGE version… it’s a nice fit for the tab 7.7
  • I’m using it in tandem with the RAM-Mount cradle above and it does fit. The extra material at the top is kind of crammed in there and there’s a bit of bowing in the plastic surface.. but the touch screen works fine.
  • Honestly, depending on how often you plan on needing that sort of thing you might just get by with a new heavy Ziploc bag each ride… hi-ho landfill! 🙂
  • I went ahead and got some Desiccant packs while I was at it just in case… you may have some in an old shoe box or something
  • $20 @ Amazon
Samsung OEM “Book Cover” Case
OEM Samsung Book Cover Case for Galaxy Tab 7.7 EFC-1E3NBEOEM Samsung Book Cover Case for Galaxy Tab 7.7 EFC-1E3NBE
  • A bit pricey around $40 street and often out of stock
  • I definitely like how this fits into day-to-day usage
  • it’s thin, light, hard shell, unbreakable kind of plastic
  • tab snaps into stiffer corners so it won’t fall out
  • there is some corner drop protection… not extensive rubber pads, but some extra shock absorption plastic there on the corners.
  • there is rubber on two edges so theoretically you could stand it up in landscape mode but I have found that the angle where it will stand up without sliding back down flat is not really conducive to real usage… one would have to rig something behind it to block it from sliding.
“OTG” USB Host Adapter
image
  • OTG = On The Go… apparently it’s a standard that allows for swapping the master-slave role … not sure why that helps since we’d want the tab to be the host in all scenarios I can think of… flash drive, hard drive, keyboard, etc.
  • $6.70 @ Amazon
  • See USB Mass Storage Watcher in the apps section below.
  • No surprise, the tab couldn’t power a 2.5” USB HDD.
USB Charge Adapter (aka “Filter Plug”)
image
  • This little bugger takes some explaining… the nutshell is that some of these devices like the gtab are checking for a special USB pin configuration to take a charge from a USB connection.
  • This is an example thread to get some more background… including self hacked cables.
  • The other thing to be aware of is that the stock AC charger pumps 2.1Amps… so if you go with another source (e.g. external batt), then you want to shoot for that higher amperage to ensure the fastest charging… see “External Battery” section below,several units are addressing this requirement now.
  • Got mine on Amazon for $5.90 + $5.50 shipping (gip)
  • They go for super cheap on eBay and DealExtreme
External Battery
PowerTraveler PowerMonkey eXtreme
image
  • I wound up getting a yellow model for $180… it’s smaller than I thought it would be (which is great). Very light and portable. I like the overall package even if it is a little too pricey. I honestly haven’t used it much at all since my whole paradigm shifted once we left Germany and moved to Seattle. Hopefully this will all swing back into normalcy once we get moved into our new money pit and can hit the trails in a camper with the kiddos.
  • review
  • $190
  • 9000Mah
  • 2.1A USB with a pigtail
  • 242 grams
  • AUTO-OFF
  • completely WATERPROOF
  • comes with a CASE, lots of tips & outlet adapters
  • does NOT come with the required USB adapter for the gtabs; see USB charge adapter above. PowerTraveler does sell their own version of this adapter.

Alternatives:

Bluetooth Keyboards
Think Outside/Sierra Stowaway AND AmazonBasics model
imageimage
  • Foldup styles:
    • Long since discontinued, the Think Outside is slick, fragile, but very slick… the key feel is great and the outside snaps shut into a cool shiny, chrome case… they’re experiencing a funny price spike circa Q1 2012, going for $250 on Amazon is crazy… this thing probably retailed for $100… I got mine for $65 on eBay a couple years back… there is another Stowaway model – iGo Ultra Slim that only folds once and seems practical as well.
    • Nomad Mobile has a good rendition of another common style single fold … these go for cheaper elsewhere.
  • Non-foldable:
    • The Apple Bluetooth Keyboard is the gold standard really… razor thin, aluminum, awesome feel to the keys.
      • one catch, no friggin delete key… there’s a backspace but no “forward” delete, you have to hit FN-Backspace to get forward delete.
      • also, no true numpad but that’s sort of what you want in a portable anyway.
    • I noticed Amazon has a nice knockoff of the Apple style now.
      • It has a delete key and there’s a customer image that shows it’s actually a tad shorter than the Apple.
    • Logitech has a polished looking tablet keyboard option with integrated case/stand now too:

           image

Media / Charging Dock

image

  • Has HDMI but it’s annoyingly the mini version invariably requiring more hanging adapter bulk 🙁
  • Also has headphone audio out if you need it.
  • The usual plastic quality build, basically works but feels kind of wobbly when you insert.
  • I’d give this a mild recommendation… didn’t see anything else as a worthy challenger at the time.
Zephyr HxM – Bluetooth Heart Rate Monitor

image

  • You can also go with a Nike+ wireless protocol, Polar makes a Nike+.
  • or there’s the more open ANT+ protocol, for which Garmin has a couple ANT+ monitors and are the cheapest… ANT+ sounds reliable but,
  • I went with Bluetooth to avoid the need for an ANT+ dongle… some phones are starting to include this radio natively.
  • Bluetooth options are slim, the Zephyr seemed to review better than the Polar Bluetooth.
  • Amazon wasn’t stocked so I ordered from Endomondo for $75 bones (ouchy)
  • Pairing worked as instructed, showed up right away in the Endomondo sports tracking app and reported numbers similar to my arm band blood pressure monitor.
  1. Make sure it’s fully charged, plugged to the strap, the strap pads have to be pretty wet & you have to put it on
  2. Do normal Android bluetooth pairing; code: 1234
  3. Then go into the Endomondo app > Settings > Accessory Settings > Connect To Sensors > Scan
Mujjo Capacitive Gloves
image
  • Couldn’t resist springing for these while I was at the Endomondo store – $35 … kinda pricey
  • They work… Angry Birds is playable, I wouldn’t want to type with them though… I got the Male M/L size… I would say my hands are medium and there’s just a bit of extra length to the fingers… with normal gloves I wouldn’t care but it obviously matters for touch screen precision… if you have small hands, consider the women’s size… they are very stretchy material.
Not Recommended
Motorola S10-HD Bluetooth Stereo Headphones with Microphone
image
  • $60 @ Amazon
  • too expensive in my opinion
  • the headphone sound is “OK”
  • the microphone sound quality is pretty bad
  • they’re really tight on my ears with my fat head and the design just makes them that way with no relief … I basically hate these and wish I never got them at this point… anybody want a deal on a completely unused pair?
  • all the buttons you’d want… volume and pause/play, fwd/rev and probably a call hang-up
Case Logic LNEO-7 7-Inch Sleeve
image
  • Update 2012-07-4: I wound up going with the OEM Samsung “Book Cover” case and haven’t looked back. See those comments above.
  • It’s “OK”… fits pretty well…just a little snug around the corners but not bad
  • no room for much of anything in the cramped pouch… the USB cable and a pigtail would be about max.
  • Can’t lose for $14.50 @ Amazon
Armor Suit – Screen Protector
image
  • This one looked good to me because it has a liquid approach to ironing out the bubbles … update 2012-07-04: the spray bottle solution was a good trick, I still got dust in there but that’s hard to avoid.
  • I paid $17 + shipping @ Amazon and it’s already down to $10… feeling a bit gipped 🙂
  • After I got the Samsung Book Cover case (see above), I ditched the screen protector, feeling that it took away from the display a bit and the case is plenty of scratch protection during transit which was my personal biggest concern… this is definitely personal preference area.
Wish List
Keyboard Stands & Charging Docks
Incase Origami Workstation for Apple Wireless Keyboard

image

  • Haven’t found anything perfect yet… everything is missing something… at the moment, a makeshift cardboard stand with the charge/usb cables is working better than I expected.
  • Samsung’s keyboard dock – doesn’t have HDMI port
  • Also just considering a case/stand for my Apple Bluetooth keyboard – Incase Origami Workstation: demos ok, not great
 
 
Recommended Apps:
 
App Name
Notes
root.zip (free)
(gtab 7.7 specific)
rooting instructions
BusyBox (free) Loads grep, awk and ash (shell)
SuperUser (free) Everything cool requires it
Android Terminal Emulator by Jack Palevich (free)
  • Make ash (from BusyBox) the default shell: /system/xbin/ash –
  • Make this the initial command to be su by default: su –c /system/xbin/ash
Root Explorer ($$) Has a nice and easy “mount as R/W” button.
ES File Explorer (free) Does everything in one shot… nice icons, *fast* SMB client (Windows File Sharing), FTP client, built in text editor, image viewer, even movie player
NtfsSd (gtab 7.7 specific)
  • Found in this xda-dev thread; mounts your NTFS formatted external sdcard in the native path (/mnt/sdcard/extStorages/SdCard) which is a bit of trick… main advantage for me is that external SDCard shows show up in Explorer when USB connected to PC; other NTFS mounting approaches (e.g. Drive Mount) were not showing SDCard on PC.
  • Symbolic links don’t work to fat32/exFat/vfat hence why NtfsSd is doing an interesting trick of some sort.
  • There is a native linux command for mapping external filesystems (i.e. a FAT drive) to internal paths but it doesn’t hold up across reboots which becomes more of a pain than you’d initially think.
    • mkdir /mnt/sdcard/extStorages/SdCard/Music
    • mount -o bind /mnt/sdcard/extStorages/SdCard/Music /mnt/sdcard/Music
USB Mass Storage Watcher OTG (free) (by Skidmrk) Mounted my 2.5” USB NTFS HDD via the OTG USB pigtail just fine (the HDD required external power).
OsmAnd (free, but buy it) This really makes my day… Open Street Maps (OSM) with the Open Cycle Maps (OCM) layer is the bees knees… this App readily downloads the map tiles for whatever is currently displayed, with whatever zoom levels you choose and then you’re ready to go off-road/offline… couldn’t be easier… it even does offline routing!!
Evernote Skitch and all the integration on a mobile device is pretty killer.
Tasker, Locale Execute Plug-In I came across this as a way to re-run mount commands after each reboot (see “mount –o bind” notes above).
doubleTwist (free) + AirSync ($$) It basically works but I punted… The issues I have are probably mostly related to the still settling Android SDCard ecosystem.
Music WithMe (free) Currently trying this as my iTunes sync’er after doubleTwist (DT) would only see internal storage Music folder… Tasker + Execute + bind mount (above) probably would’ve bridged that gap but Music WithMe (MWM) has a simple music storage path setting, looks promising. MWM seems to report its sync status more robustly than DT. MWM integrates through FaceBook so you get into sharing what you’re listening to and what friends are listening to. I’ll check that out if the basics pan out.