Sideload APK on Nook without Rooting

These instructions are for a Nook Color 1.4.3, It may work on other Nooks, feel free to comment if it differs on your device.
First, Press the “n” key, and press apps
Press the Volume up key and the “// Library” logo at the top of the screen, you should move to the “Extras” page.
Press “Nook Color Tools”.
Double check the “Allow Non Market Apps”
– From here, I was able to download an APK via DropBox, and install it… No more installing APKs via ADB 🙂
Android app crashes on launch
This is probably the first mistake that any Android developer makes, so seasoned developers will know this issue very well:
Three things MUST match on your android app:
The App.Java file, should take the following format:
package com.openmerchantaccount.ruby;
import android.webkit.WebSettings;import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;public class App extends DroidGap {
Your package name will be different, but I’m highlighting the important bit.
Then in the Android Manifest the (AndroidManifest.xml) should start as follows:
<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android”
package=”com.openmerchantaccount.ruby”
android:versionCode=”2″
android:versionName=”2″>
and end as follows:
<activity android:name=”com.openmerchantaccount.ruby.App”
android:label=”@string/app_name”
android:configChanges=”orientation|keyboardHidden”
>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</activity></application>
</manifest>
If any of the three class names do not match, the app will crash on startup.
Nook Color 1.4.3 pre-installed apps
After finally getting ADB working and connected to my Nook, I decided to take a look at the ‘Bloatware’ that was already pre-installed;
C:\android\adt-bundle-windows-x86\sdk\platform-tools>adb shell
# pm list packages -f
pm list packages -f
package:/system/app/BnPolicyManagerSvc.apk = com.bn.policymanager.svc
package:/system/app/DefaultContainerService.apk = com.android.defcontainer
package:/system/app/Launcher2.apk = com.android.launcher
package:/system/app/HomeCatcher2_1.apk = com.gojimi.homecatcher
package:/system/app/Gallery.apk = com.bn.nook.gallery
package:/system/app/QuickSearchBox.apk = com.android.quicksearchbox
package:/system/app/TouchCalibrator.apk = com.bn.touchcalibrator
package:/system/app/DRPReader.apk = com.bn.nook.drpreader
package:/system/app/MarketUpdater.apk = com.android.vending.updater
package:/system/app/LatinIME.apk = com.android.inputmethod.latin
package:/system/app/Phone.apk = com.android.phone
package:/system/app/Social.apk = com.bn.nook.social
package:/system/app/OneTimeInitializer.apk = com.google.android.onetimeinitializer
package:/system/app/GooglePartnerSetup.apk = com.google.android.partnersetup
package:/system/app/WWReader.apk = com.bn.nook.wwreader
package:/system/app/QuickStartActivity.apk = com.bn.nook.quickstart
package:/system/app/Reader.apk = com.bn.nook.reader.activities
package:/system/app/HTMLViewer.apk = com.android.htmlviewer
package:/system/app/CalendarProvider.apk = com.android.providers.calendar
package:/system/app/NookColorTools.apk = com.benhirashima.nookcolorsettings
package:/system/app/RDRPReader.apk = com.bn.nook.rdrpreader
package:/system/app/Library.apk = com.bn.nook.library
package:/system/app/Calendar.apk = com.android.calendar
package:/system/app/Shop.apk = com.bn.nook.shop
package:/system/app/Browser.apk = com.android.browser
package:/system/app/GoogleFeedback.apk = com.google.android.feedback
package:/system/app/Music.apk = com.android.music
package:/system/app/Talk.apk = com.google.android.talk
package:/system/app/ThumbnailService.apk = com.bn.nook.thumbnailservice
package:/system/app/RomManager.apk = com.koushikdutta.rommanager
package:/system/app/UserDictionaryProvider.apk = com.android.providers.userdictionary
package:/system/app/TtsService.apk = android.tts
package:/system/app/AirRuntime.apk = com.adobe.air
package:/system/app/Fava.apk = app.com.book.fava.FavaApp
package:/system/app/DownloadAdmin.apk = com.bn.nook.dadmin
package:/data/app/com.openmerchantaccount.athens-1.apk = com.openmerchantaccount.athens
package:/system/app/Crossword.apk = com.encore.crossword
package:/system/app/Email.apk = com.bn.nook.email
package:/system/app/MediaProvider.apk = com.android.providers.media
package:/system/app/Oobe.apk = com.nook.oobe
package:/system/app/CertInstaller.apk = com.android.certinstaller
package:/system/app/CloudService.apk = com.bn.nook.cloud.service
package:/data/app/air.NookViewer-1.apk = air.NookViewer
package:/system/app/Home.apk = com.bn.nook.home
package:/system/app/GSearch.apk = com.bn.nook.gsearch
package:/system/app/GoogleCalendarSyncAdapter.apk = com.google.android.syncadapters.calendar
package:/system/framework/framework-res.apk = android
package:/system/app/ContactsProvider.apk = com.android.providers.contacts
package:/system/app/Settings.apk = com.android.settings
package:/system/app/Protips.apk = com.android.protips
package:/system/app/MediaUploader.apk = com.google.android.apps.uploader
package:/system/app/ApplicationsProvider.apk = com.android.providers.applications
package:/system/app/NookCommunity.apk = com.bn.nook.community
package:/system/app/Street.apk = com.google.android.street
package:/system/app/GenieWidget.apk = com.google.android.apps.genie.geniewidget
package:/system/app/Sudoku.apk = com.encore.sudoku
package:/system/app/BnCloudRequestSvc.apk = com.bn.cloud.svc
package:/system/app/Chess.apk = com.bn.nook.chess
package:/system/app/GoogleQuickSearchBox.apk = com.google.android.googlequicksearchbox
package:/system/app/DrmProvider.apk = com.android.providers.drm
package:/system/app/Vending.apk = com.android.vending
package:/system/app/Accessories.apk = com.bn.nook.accessories
package:/system/app/B3AndroidReader.apk = com.balthaser.android.reader
package:/system/app/BnAuthenticationService.apk = com.bn.authentication.svc
package:/system/app/LiveWallpapersPicker.apk = com.android.wallpaper.livepicker
package:/system/app/Gmail.apk = com.google.android.gm
package:/system/app/CryptoServer.apk = com.bn.app.crypto.server
package:/system/app/PackageInstaller.apk = com.android.packageinstaller
package:/system/app/TelephonyProvider.apk = com.android.providers.telephony
package:/system/app/LiveWallpapers.apk = com.android.wallpaper
package:/system/app/AccountAndSyncSettings.apk = com.android.providers.subscribedfeeds
package:/system/app/Pandora.apk = com.agilefusion.android.pandora
package:/system/app/BnAppInstaller.apk = com.bn.bnappinstaller
package:/system/app/PicoTts.apk = com.svox.pico
package:/system/app/Superuser.apk = com.noshufou.android.su
package:/system/app/Maps.apk = com.google.android.apps.maps
package:/system/app/YouTube.apk = com.google.android.youtube
package:/system/app/SettingsProvider.apk = com.android.providers.settings
package:/system/app/MagicSmokeWallpapers.apk = com.android.magicsmoke
package:/system/app/GoogleServicesFramework.apk = com.google.android.gsf
package:/system/app/AppLauncher.apk = com.bn.nook.applauncher
package:/system/app/SysChecksum.apk = com.bn.syschecksum
package:/system/app/AFfileDownloadService.apk = com.bn.nook.affiledownloadservice
package:/system/app/Quickoffice_Viewer.apk = com.bn.nook.reader2
package:/system/app/DeviceManager.apk = com.bn.devicemanager
package:/system/app/DownloadProvider.apk = com.android.providers.downloads
package:/system/app/HomeWidgets.apk = com.bn.nook.widgets
package:/system/app/DemoModeApp.apk = com.bn.nook.demomode
package:/system/app/GoogleContactsSyncAdapter.apk = com.google.android.syncadapters.contacts
package:/system/app/VpnServices.apk = com.android.server.vpn
#
Firefox OS “Hello World”
After meeting the Firefox OS guys at the MWC in Barcelona, I decided to give a go to porting my first app from PhoneGap (BlackBerry) to FireFox OS. The app I chose, was a simple HTML based app, with no requirement for access to device sensors etc. It used Jquery Mobile, but not much else.
First up, is that you have to put a file called manifest.webapp into the root (/www) folder of the app, with someting like the following content:
{
“name”: “Free SMS”,
“description”: “A firefox OS app that allows you send free SMS text messages from your firefox smartphone to most European countries”,
“launch_path”: “/index.html”,
“icons”: {
“128”: “/resources/icon128.png”
},
“developer”: {
“name”: “Open Merchant Account Ltd”,
“url”: “http://www.openmerchantaccount.com ”
},
“default_locale”: “en”
}
Of course, the files index.html and /resources/icon128.png need to exist, and icon128 needs to be 128×128 pixels in size. Zip the folder up, ensuring that manifest.webapp and index.html are at root level of the zip file.
Create an account at firefox marketplace, and go to https://marketplace.firefox.com/developers/submit/app/manifest – I selected packaged app, although the website recommends a that you choose hosted. Press select a file, and upload the zip. If everything works ok, then you should be able to move to the next page where you should supply screenshots, and marketing text.
In order to create screenshots, then you’ll need the latest version of firefox, then download firefox_os_simulator xpi at https://marketplace.firefox.com/developers/docs/firefox_os_simulator – This plugin can then be installed by pressing Tools > Add ons > Gear icon > Install add on from file. Once the add on is installed, press “Add Directory” and select the manifest.webapp from your hard drive.
The simulator should kick into life, and if you unlock it, then swipe the apps right a few pages, you should see your app. Click to launch, and snap a few screenshots.
Currently Firefox OS marketplace appears to be available only for US, UK, Brazil and Spain, but it should increase in time.
My completed zip can be downloaded from my RPI server here http://www.servedwithpi.com/firefoxos.zip
Get a profile ID from Facebook URL in C#
If you want to convert a Facebook URL like http://www.facebook.com/LambOfficial into a profile id, “56062886901”, so that you can link to the page using the FB:// protocol, i.e. FB://profile/56062886901 – which looks better than a web link on iOS. Then the simple trick is to replace the “www” with “graph”, and then look for the id parameter.
To do this from code, then you would use something like this:
const string strFBRegex = @”id.:..(?<id>\d+).,”;
var strGraphUrl = strUrl.Replace(“www”, “graph”);
var wc = new System.Net.WebClient();
var strGraphJson = wc.DownloadString(strGraphUrl);
strId = System.Text.RegularExpressions.Regex.Match(strGraphJson, strFBRegex).Groups[“id”].Value;
Where strUrl is the input url, and strID is the output.
However, this does not account for facebook pages that have the format http://www.facebook.com/pages/pagename/id, in which the profile id is visible in the url, but the graph page does not work.
So, something like this catches this case also:
var strId = “”;
if (!strUrl.ToLower().Contains(“/pages/”))
{
const string strFBRegex = @”id.:..(?<id>\d+).,”;
var strGraphUrl = strUrl.Replace(“www”, “graph”);
var wc = new System.Net.WebClient();
var strGraphJson = wc.DownloadString(strGraphUrl);
strId = System.Text.RegularExpressions.Regex.Match(strGraphJson, strFBRegex).Groups[“id”].Value;
}
else
{
strId = System.Text.RegularExpressions.Regex.Match(strUrl, @”\d+”).Value;
}
strFBUrl = “fb://profile/” + strId;
Installing a HTTP Proxy on Debian 4 (ETCH)
I’m very much a Linux newbie, however, I just managed to install a HTTP proxy on my Linux box, with a view to install it on my Raspberry pi. Which will provide me with a proxy server with a dynamic IP address.
The abridged version is quite simple:
1. Run apt-get update
2. Run apt-get install tinyproxy
3. Edit /etc/tinyproxy/tinyproxyy.conf and  add a “#” before the Allow lines to make the proxy public
4. Run  /etc/init.d/tinyproxy restart to apply the configuration changes.
I initially thought there was a problem when I went to the proxy url directly
Cache Error!
The following error has occured: Unknown URL type
Generated by tinyproxy (1.6.3)
But this is perfectly normal, you’re not supposed to request it directly.
Use Google Docs as a basic CMS
If you want to provide a really quick CMS back end to a website or app, then you can use Google Doc’s spreadsheet CSV export, and a CSV-to-JSON proxy.
If you just create a spreadsheet in Google Docs, then press “Publish the web”, get the link and note the “KEY” parameter – then you can use the key in the following url:
http://dananos.brinkster.net/gdoc2json.php?KEY=0AtUK1jTDzCmodEtEYUE4alVjdUVvdFVHcWZlTlNub1E
where “KEY” is taken from the Google Doc.
You can then call this URL from your app.
Take a picture and upload it using Webworks on Playbook
When I tried to port a BlackBerry Phonegap project (v 2.0.4) to Playbook (QNX), I noticed that the camera did not return data as Base64 data, rather a FILE_URI, despite the Camera destination type being set to DATA_URL – So going back to first principles, I tried to re-implement the camera capture using BlackBerry WebWorks only.
After 14 tests and failures, this is the final version that worked:
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” >
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″>
<meta name=”viewport” id=”viewport” content=”height=device-height,width=device-width,user-scalable=no” />
<script src=”jquery.js”></script>
<script language=”javascript” type=”text/JavaScript” >
function takePicture()
{
blackberry.media.camera.takePicture(successCB, closedCB, errorCB);
}function successCB(filePath)
{
var can = document.getElementById(‘canvas’);
var ctx = can.getContext(‘2d’);
var img = new Image();
img.onload = function(){
can.width = img.width/10;
can.height = img.height/10;
ctx.drawImage(img, 0, 0, img.width/10, img.height/10);
var b64Text = can.toDataURL();
b64Text = b64Text.replace(“data:image/png;base64,”,””);
upload(b64Text)
}
img.src = filePath;
}
function upload(imageURI)
{
try
{
$.ajax({
type: “POST”,
url: “http://xxx.yourwebsite.com/upload.aspx”,
data: { image: imageURI}
}).done(function( msg ) {
alert(msg);
}).fail(function(a,b){
alert( “Failed to save:” + b);
});
}
catch(ex)
{
alert(ex);
}
}
function closedCB() {}
function errorCB(e) {}
</script>
</head>
<body >
<p>(V14) Test the Camera by pressing the button below</p>
<b><a href=”#” onclick=”takePicture();”>Take a Picture</a></b><br>
<canvas id=”canvas”></canvas>
</body>
</html>
Again, I’ve omitted the URL of the uploading script, but the source code for this can be found earlier in this blog.
I did notice that Webworks’ BlobToString BASE64 didn’t seem to work, so I instead, drew the image onto a canvas, (resized to a 10th of the normal size, since the PlayBook’s photos are massive). And called toDataURL on the canvas to get the Base64 image, then stripped off the data:image/png;base64,
Now, to replace the non-working Phonegap code with this working code…
Invalid config.xml – the value of id attribute is not valid
I decided eventually to upgrade from Phonegap-0.9.4 to Phonegap 2.4.0 for my BlackBerry development work after having trouble getting the camera to work, the old phonegap was ignoring my targetWidth / targetHeight parameters, couldn’t close the camera (key injection), and failed to save any image over 1.5 Meg.
Anyway, the new phonegap got round most of the problems with the camera, but when it came to packaging for the Playbook, I hit this error “Invalid config.xml – the value of id attribute is not valid”
load-device:
[exec] [INFO] Parsing command line options
[exec] [INFO] Parsing bbwp.properties
[exec] [INFO] Validating WebWorks archive
[exec] [INFO] Parsing config.xml
[exec] [ERROR] Invalid config.xml – the value of id attribute is not valid
The issue was simple to fix, but didn’t seem to be explained online, so here’s the solution:
<widget xmlns=”http://www.w3.org/ns/widgets”
xmlns:rim=”http://www.blackberry.com/ns/widgets”
version=”1.0.0.0″ id=”org.apache.cordova.example”>
Just Remove the id attribute from the <widget> tag, and it works!
Remove
Debugging live device on Blackberry
A Bit of an “easter egg” when it comes to debugging BlackBerry phones, is the key combination ALT + lglg, which, if you type in on the home screen of a blackberry phone shows the system error log. If you clear this, then run your app, errors and alerts will be written here.
When trying to port an iPhone Phonegap app to BlackBerry Webworks, the camera wasn’t working right. I could see it opening the camera, but it didn’t close the camera app automatically, and no data seemed to be uploaded.
I used this code example straight from the demo code:
navigator.camera.getPicture(onCaptureSuccess, onCaptureFail,
{ destinationType: Camera.DestinationType.DATA_URL, quality: 50 });
But it appears that at Quality 50, the image data is still too big – I’m going to try reducing this, and I’ll update this post if it works.
*Update*
Using the camera on Phonegap 0.9.4 is a non-starter. There is a size limit of 1.5 MB per photo, and the quality parameter, along with targetWidth and targetHeight are ignored. Also, the native camera app will not close unless you ask the user to manually turn on key injection. (Options > Application Management > Select App > Edit Permissions > Interactions > Â Input Simulation > Allow).
Simple solution was to upgrade to Phongap 2.4.0 and then set the targetWidth and targetHeight to something more manageable.

