[NOOK] Walkthru - Deploying on a Test Device and Getting Ready for Store Deployment

So I’m finally sitting down to write this tutorial to help you get your games out to the NOOK Apps Market. Hopefully someone finds this helpful. I’m also assuming that you’re already a certified NOOK Developer and you can deploy games to the NOOK Apps Market.

General Disclaimer

This is only a guide and I offer no legal or tax advice on anything and I am not held responsible for anything that should happen as a result of following this guide, including any financial loss, or damage to any property, or loss of data that you or others may incur. YOU ARE USING THIS GUIDE/WALKTHRU/TUTORIAL SOLEY AT YOUR OWN RISK.

Making your NOOK a device you can test on (Developer Mode)

If you have a NOOK to test on you need to put the device into developer mode. This is easily done on the NOOK App Developer site and once you download and install your provision you can connect to the device via adb. There are tutorials on NOOK App Developer site that walk you through this process once you’ve qualified as a NOOK App Developer. You have to put your NOOK into developer mode otherwise you will not be able to test with the device.

Next you’ll need to make sure that you have the latest version of the Android SDK installed - http://developer.android.com/sdk/installing.html

Once you have that installed you’ll need to run it to be able to add the NOOK Tablet and NOOK Color devices, by adding this as an Add-on Site - http://su.barnesandnoble.com/nook/sdk/Nook_Tablet_addon.xml (These instructions are also available on the NOOK App Developer site.)

The entries for the NOOK devices are under the Android 2.3.3 (API 10) for NOOK Tablet and Android 2.2 (API 8) for NOOK Color.

You’ll also want to make sure you can connect to your NOOK via adb, so check the adb_usb.ini file in the .android/ directory where you user’s home directory is (this is different based on your OS.) There should be a line in the file that has 0x2080.

[blockcode]

SAMPLE FILE

ANDROID 3RD PARTY USB VENDOR ID LIST – DO NOT EDIT.

USE ‘android update adb’ TO GENERATE.

1 USB VENDOR ID PER LINE.

0x2080
[/blockcode]

If all is setup correctly you should be able to connect your NOOK and run adb to send the apk to it. If you have problems running adb you can just execute it with no options and it will give you some help. adb is a powerful tool, make sure you know what you’re doing before you execute any commands with it!

Once all these are setup it’s very easy to send your app to your device, but there is only one downside, you can’t get your app on the main screen for easy access, so YOU HAVE TO SEARCH for your app on your device in order to test.

In Summary:

  • Become a Certified NOOK App Developer

  • Enable Developer Mode on your NOOK Device

  • Download the NOOK Add-Ons for the Android SDK

  • Make sure adb is configured correctly

  • Use adb to send your apk to the device

  • Find the apk on your device by using the search feature

Getting your App Ready for Submission

You will want to use your own keystore / signing certs to use during the Corona build of the apk.

Here’s a quick command to generate a keystore if you haven’t done one already:

keytool -genkey -v -alias \<SOME\_ALIAS\> -keystore \<KEYSTORE\_FILE\_LOCATION\> -keyalg RSA -keysize 2048 -validity 10000 -dname "\<SOME\_LDAP\_TYPE\_NAME\>"

Obviously you’ll replace <TEXT> with something more meaningful. Here’s an example -

keytool -genkey -v -alias MyAppsKeyAlias -keystore mykeystore.keystore -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Awesome Application,O=Aweseme Game Company Name,C=US"

The keytool will prompt you for a few passwords, so you’ll want to memorize them, as you’ll need them to be able to get at the keystore from the Corona build process, or if you ever want to inspect / change the certificates.

If you want to know more about keytool and how you generate your keystore you can research that here - http://developer.android.com/guide/publishing/app-signing.html

Clearly after all this trouble of generating your keystore, you’ll want to use this keystore when building your app. YOUR APP WILL BE REJECTED IF YOU USE THE DEBUG KEYSTORE. You also don’t want to share your keystore as it contains your private key(s). Protect it like you would any other sensitive data.

You should also prepare a few images that will be needed for you app’s meta-data submission:

A 300x300 App Icon and 4 600x1024 Screen Shots (preferably from the device. If you hold down the NOOK’s “n” button and the volume down button it will take a screen shot for you.)

Once you have all this you are ready to put your app’s info on the NOOK App Developer site for approval.

The app review process is a bit different for NOOK than other stores. First you submit your meta-data for review, and once that’s approved you can then upload your APK for approval. Once the app is approved it takes up to 48 hours to make its way into NOOK Apps.

In Summary:

  • Create your own keystore

  • Build your apk with the keystore

  • Prepare a 300x300 App Icon and 4 Screen Shots (600x1024)

  • Submit your App’s Meta-Data and wait for approval

  • Submit your App and wait for approval

  • Once fully approved it will take at most 48 hours for your App to show up

That’s all there is to it!

Good Luck and Happy Coding!

If you have questions or need help you can find me lurking on the #corona IRC channel on freenode as Tyraziel. [import]uid: 57050 topic_id: 24855 reply_id: 324855[/import]

Fantastic stuff; am going to sticky :slight_smile: Thanks for posting this. [import]uid: 52491 topic_id: 24855 reply_id: 100958[/import]

Hi.

Thanks so much for posting this.

I’ve been struggling for weeks trying to get my app to work on the nook. I was successfully able to get one of my apps approved from the nook Developers without having to actually test on a nook Device, by my second app is having a lot of problems, so I bit the bullet and bought the nook Tablet. However, I’m stuck and I just can’t figure out what I’m doing wrong that I can’t get the app on my nook. I must be a moron. I’ve gotten it to work on iOS, Android and Kindle Fire devices.

Since I’m using Corona, i’m not at all familiar with the Android SDK because we never need to use it. So would it be possible to dumb down your instructions even more? So far i’ve gotten the provision file installed. I downloaded the Android SDK and added on the nook plugin. And i’ve gotten to the ADB command line (Using a mac). But now I’m stuck and can’t figure out how to send the .apk file to the nook. I’ve tried:
./ adb install /Users/gregory_hargis/Adopt\ A\ Club.apk

comes back saying the directory is found, but doesn’t actually install anything.

I’ve also tried:
./ adb push ,local> /Users/gregory_hargis/Adopt\ A\ Club.apk

and got an error.

Anyways, any help would be more than greatly appreciated. Thanks so much for taking the time to go over this. If I ever figure it out, maybe I’ll do a video tutorial on how to get the nook into developer mode for the more visual people out there

Thanks

[import]uid: 90878 topic_id: 24855 reply_id: 101171[/import]

@gregory, I’ve just gone through this recently, and here’s the command I used to install/uninstall my game:

Nook Device ID = 12345678900 << fake one, but using it to illustrate the command

Directory location of the Android SDK folder = desktop/androidsdk

APK filename = myApp.apk

Place the APK file in the platform-tools folder (I did this because it’s the easiest way for me to handle)

package identifier = com.mywebsite.myapp

  1. Launch Terminal.app

  2. change the directory by typing the following:

cd desktop/androidsdk/platform-tools

  1. install the app by typing the following:

./adb -s 12345678900 install myApp.apk

  1. uninstall the app by typing the following:

./adb uninstall com.mywebsite.myapp
The adb command comes always after the directory is changed to platform-tools.

I hope this helps.

Naomi

Note: I use Mac and I’m using this terminal command for installing/uninstalling test build to/from NOOK Tablet. [import]uid: 67217 topic_id: 24855 reply_id: 101177[/import]

@Gregory,

Try building the apk with no spaces in the app name.

Or you might want to try this ./adb install “/Users/gregory_hargis/Adopt A Club.apk” and see if that works.

The other thing I’m noticing is that you have a space between your ./ and adb command.

Also you can append the android SDK platform-tools directory to your path variable. (This is a bit more advanced because you need to setup your mac to read a .bashrc file in your home directory.) That way you can run adb from any directory.

Hope this helps! [import]uid: 57050 topic_id: 24855 reply_id: 101249[/import]

Hi Naomi and Toz. Thanks so much for your feedback. I still can’t seem to get it to work.

  1. I’ve tried connecting the nook to the mac and run the code, as well as connecting the nook, ejecting it, but leaving it physically connected so it’s in debug mode. and then run the code. Which should it be in?

  2. Ran a bunch of variations, but still can’t get it to work. I’ve moved it into my “platform-tools” folder like you suggested. I ran this code:

  
Last login: Mon Apr 16 19:23:30 on ttys004  
Gregory-Hargiss-iMac-3:~ gregory\_hargis$ cd  
Gregory-Hargiss-iMac-3:~ gregory\_hargis$ /Users/gregory\_hargis/android-sdk-macosx/platform-tools   
-bash: /Users/gregory\_hargis/android-sdk-macosx/platform-tools: is a directory  
Gregory-Hargiss-iMac-3:~ gregory\_hargis$ ./adb -s 20211230040044013 install Adopt.apk  
-bash: ./adb: No such file or directory  
Gregory-Hargiss-iMac-3:~ gregory\_hargis$   
  

Sorry, I just don’t know what I’m doing wrong. I just don’t have any experience with Android’s SDK. Do I need to be installing on an SD card? I don’t have one, but could get one if it’ll help.
Thanks again for your time. [import]uid: 90878 topic_id: 24855 reply_id: 101428[/import]

Hey Gregory,

First off I would suggest your mask some of your terminal output next time.

Secondly where is your Adopt.apk file built to?

You need to combine the command on lines 2 and 3 to make the following command:
[blockcode]cd /Users/gregory_hargis/android-sdk-macosx/platform-tools[/blockcode]

You also don’t need the -s option, only if you have more than one device connected to your mac at the same time.

Lastly you need to know the location of where your Adopt.apk is and provide the full path to the adb command.

Hope this helps.

I’m on the IRC chat (#corona on freenode.net) too as Tyraziel if you’d like to chat over there.

[import]uid: 57050 topic_id: 24855 reply_id: 101440[/import]

Thank you, Toz, for explaining what -s does.

Gregory, did you sort this out? If not, just in case it helps, the command “cd” represents “change directory” (I think).

So, when I first start my Terminal.app, it may open up like this:

MacBook:~ username$  

In your case, the “username” is probably replaced with “gregory_hargis”.

Assuming you have Android SDK folder placed on Desktop, I’d then type like this to change directory to the subfolder named “platform-tools” that is placed inside androidsdk folder:

-- this is what I type:  
MacBook:~ username$ cd desktop/androidsdk/platform-tools  
  
-- after I hit enter, this is what I see:  
MacBook:platform-tools username$   
  
-- then I start typing adb command like this  
-- keep in mind, I have copied myApp.apk to platform-tools folder inside the androidsdk folder  
MacBook:platform-tools username$ ./adb 12345678900 install myApp.apk  
  
-- now myApp.apk is installed on Nook tethered to the Mac.  

By the way, do you have platform-tools folder inside your Android SDK folder? If not, you need to get it. Inside the tools folder (which is inside the Android SDK folder), there’s an instruction text file called adb_has_moved.txt – follow its instruction and install “Android SDK Platform-tools”. Without it, you can’t use adb command.

I hope this helps.

Naomi [import]uid: 67217 topic_id: 24855 reply_id: 101469[/import]

@Naomi,

You don’t need the NOOK’s serial number either.

http://developer.android.com/guide/developing/tools/adb.html

[blockcode]
adb [-d|-e|-s <serialNumber>] <command>
[/blockcode]

[blockcode] -d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.[/blockcode] [import]uid: 57050 topic_id: 24855 reply_id: 101578[/import]

Excellent (and timely) info.

I’ve a rooted Nook.

question: Are you guys building for Nook? I tried that but when I deployed on Nook, it gave an error saying something like “This app. will only work on Nook”.

When I build for Android, it works fine. So is it ok to build for Android while I am developing/testing? [import]uid: 12109 topic_id: 24855 reply_id: 101599[/import]

Hi everyone.
Nope, still having issues.

I am building for Nook. the application is inside the “android-sdk-macosx” folder inside “platform-tools” folder. I realized the issue of keeping the cd “location” on the same line.

I have the provision.cmd file installed on the nook. It’s connected to the computer and in USB mode for transferring files.

I’ve tried with/without the -s number. I did get en “error-device not found” which I hadn’t gotten before.

On the Andoid SDK manager I do have the nook installed under the Android version 2.3.3

I didn’t understand the part in the original post. I don’t see any adb_usb.ini file on my system.

# SAMPLE FILE  
# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.  
# USE 'android update adb' TO GENERATE.  
# 1 USB VENDOR ID PER LINE.  
0x2080  

Any ideas what i’m missing? I also tried doing everything on a different mac. Same issue. I’m sure it’s just something really stupid i’m missing. Sorry to be such a hassle. Again, any help is appreciated. [import]uid: 90878 topic_id: 24855 reply_id: 101625[/import]

@TozSoftware, thanks for the details along with the link. That’s really helpful. Sometimes there are too many things to read, and it’s so easy not to find the right place to look. I appreciate it. Knowing more can only make things easier (and less error prone).

@tsawan, this thread is all about Nook, so you are on the right track. Edit: When you generate a build that you want to install on Nook, you need to select Nook, i.e., Corona Simulator > Build > Nook (instead of Android).

@gregory, hopefully, Toz can answer your questions. By the way, is your device Nook Color or Tablet?

Naomi [import]uid: 67217 topic_id: 24855 reply_id: 101637[/import]

You need a Pro subscription to build and test on Nook and Kindle devices. Building for Android will not work. [import]uid: 7559 topic_id: 24855 reply_id: 101644[/import]

@tsawan,

I don’t know if you can do this stuff with a rooted NOOK. I actually even think that rooting a NOOK is against BN’s developer policies. Plus you won’t get a good test on the device since most people don’t have rooted NOOKs.

@gregory,

You can find me on the #corona chat on freenode.net as Tyraziel if you need more help. I don’t know why you’re having so many issues with this and going back and forth on this thread isn’t helping you out. [import]uid: 57050 topic_id: 24855 reply_id: 101725[/import]

Ok so there are a couple of things you can do to make sure that your NOOK is attached and is reporting back to your computer successfully.

First off make sure the NOOK is connected to your computer with the NOOK USB provided cable. No other cables will work for this since the end that goes into the NOOK is a tad longer.
Now, if you execute adb devices and nothing is attached you’ll get this:

[21:53:26] TozSoftware@macbox {~}>adb devices
List of devices attached

[21:53:27] TozSoftware@macbox {~}>

When I connect my NOOK and run adb I get:

[21:53:27] TozSoftware@macbox {~}>adb devices
List of devices attached
DEVICE_ID_123456 device

[21:58:29] TozSoftware@macbox {~}>

If you get nothing when your device is attached then something isn’t set up right with adb, and you probably need to check adb_usb.ini file and make sure that the adb daemon is running.

[22:00:37] TozSoftware@macbox {~}>cd .android
[22:00:43] TozSoftware@macbox {~/.android}>cat adb_usb.ini
# ANDROID 3RD PARTY USB VENDOR ID LIST – DO NOT EDIT.
# USE ‘android update adb’ TO GENERATE.
# 1 USB VENDOR ID PER LINE.
0x2080
[22:00:45] TozSoftware@macbox {~/.android}>

If that looks good, where you should at least have 0x2080 in there, if it’s not then add it using the android update adb, then kill and start the adb daemon and try the adb devices command again:


[22:02:03] TozSoftware@macbox {~/.android}>adb kill-server
[22:02:14] TozSoftware@macbox {~/.android}>adb start-server
* daemon not running. starting it now on port 5037
daemon started successfully *
[22:02:19] TozSoftware@macbox {~/.android}>

Hopefully you’re getting at least the device so show up when you run adb devices. If you’re that far that’s a good sign! [import]uid: 57050 topic_id: 24855 reply_id: 101729[/import]

Tyraziel is a rock star! We got it working.

I’m gonna post tomorrow exactly what we did to get it to work. 1st major issue, i had installed the nook api, with it not working. A couple days later, i deleted all whole android SDK folders, and thought i reinstalled everything, but i didn’t.

But after that is some code that i would have never guessed. So i’ll take the time and post it hopefully tomorrow for all those people who don’t know what they are doing when it comes to the Android SDK and installing for nook.
[import]uid: 90878 topic_id: 24855 reply_id: 101748[/import]

@gregory -

Thanks! :slight_smile:

I’ll incorporate what we went through in my main post above after you post it. [import]uid: 57050 topic_id: 24855 reply_id: 101825[/import]

This is excellent - thank you for posting this! Looking forward to getting my game onto a Nook :slight_smile: [import]uid: 131038 topic_id: 24855 reply_id: 101846[/import]

@Toz: Unfortunately I have to root my Nook Color since B&N doesn’t sell any content unless the device is physically in North America.
When I use Build->Nook, and deploy, it gives a warning that this build will only work on a Nook (so Corona is not able to recognize the device as a Nook).
When I use Build->Android, and deploy, everything works perfect.

@Tom: Please confirm this. As per docs, Ansca website, I understand that I should be able to build for Nook and Kindle Fire in debug mode. I have Corona iOS subscription and Build -> Nook/Kindle options are enabled.

Thanks [import]uid: 12109 topic_id: 24855 reply_id: 101923[/import]

Ok, after getting Tyraziel’s help, here is the Dummies version of building for Nook

Here are some breakdown of steps to get your .apk file that you built in Corona (or any .apk file really) onto your nook using a Mac.

You’ll need to have a Nook Developer account. Do that and install your provision.cmd file to your nook. To do so, connect the nook to your mac and turn it on. You should see a new drive on your mac called “MyNook”. Open “MyNook”. Drag and drop the provision.cmd file into it. Not into any of the folders. Reboot your device leaving it connected to your computer.

Building your .apk
-Build your app and make sure you use “Build for Nook”
-Stick with using only letters, and for testing purposes, don’t use spaces to try to keep the possibility of errors down.

Download the latest Android SDK
http://developer.android.com/sdk/installing.html
After it has downloaded, move that folder to your desktop for easy access.

Inside that folder, locate the “tools” folder. Open it up and double click on the “android” execute file.
It will open up a terminal window and then it will open up the Android SDK Manager.

First thing you want to do, is to install Android 2.3.3 (API 10) Toggle down the folder contents and install at least the SDK Platform and Samples for SDK. Checkmark those. Also make sure the “Tools” folder and Android SDK Tools and SDK Platform-Tools are installed. If not, checkmark those to install as well.

Then hit “Install Packages”. This might take some time depending on your internet connection.

After those have completely installed, still inside the SDK manager, to to the top menu bars and hit “Tools-Manage Add-on Sites”. Click “New” and then copy and paste this into it:

http://su.barnesandnoble.com/nook/sdk/Nook_Tablet_addon.xml
Click OK. This has not installed it yet, just added it to your list of things you can download/install. So, under the Android 2.3.3 folder you will see “Nook Tablet” (I think there maybe a different link to install Nook Color, i’m not sure.) Checkmark that and then hit the “Install Packages”. Once you have done that, you can quit out of the SDK Manager as well as any of the Terminal Windows.

Next will be dealing with the terminal. You’ve probably heard of ADB (Android debug Bridge). Basically it’s a way to interact with your device using command line. In an ideal world you’d simply be able to drag and drop an .apk file on the nook and be done, but unfortunately, it doesn’t work that way. So you get to do it through the terminal.

First, on your desktop, open the “android-sdk-macosx” folder.

Navigate back to the “platform-tools” folder, but don’t open it. We will need it in a second.
Open up a new Terminal window.
Type in:
cd

This means “Change Directory”. Don’t hit enter yet. Here’s a trick to save you time and error proof your typing. Go inside the “android-sdk-macosx” folder and drag and drop the “platform-tools” folder onto that terminal window next to the “cd” you typed in. So it should look something like this.

cd/Users/ghargis/Desktop/android-sdk-macosx/platform-tools

hit enter. It should change the directory to say :platform-tools (your computer name)$

Now we need to kill the server. so type in and hit enter:
./adb kill-server

Now we need to update the adb and type in:

cd

and drag and drop the tools folder inside your Android SDK folder into the terminal so it looks something like this:
cd /Users/ghargis/Desktop/android-sdk-macosx/tools

Change directories back to the platform-tools folder by typing in

cd

then drag and drop your platform tools folder in again and hit enter. Will look something like this.
cd /Users/ghargis/Desktop/android-sdk-macosx/platform-tools

Then you will need to Kill the server and restart it. Type in:
./adb kill-server

Hit enter and wait a minute.

Then type in and hit enter:
./adb start-server

Now we need to see if our Nook is connected. Type in:
./adb devices

It will run daemon then will say “List of denies attached”. You should see your device attached with it’s serial number. (if it didn’t work, make sure your nook is still connected. Unplug any other USB cords that might be connected to your computer. Restart your nook and run it again.)
Now that we know our Nook is connected, we can transfer our .apk file over.
In Corona, go ahead and build your project using “Build for Nook”. Once you finish that, move the finished .apk file inside your “Platform-tools” folder.

Go back to the terminal window. Now type in:
./adb install appName.apk

Where “appName.apk” is replaced by whatever your app is called. It will take a minute, but will say successful.

To reinstall the app when you’ve created a new version of your app, you can type in this:

./adb install -r appName.apk

To wipe it completely from your nook, you can uninstall your app by doing this:
./adb shell pm uninstall -k appName.apk
Ok, hard part is OVER! Now you can unplug your Nook, but first unMount the MyNook drive that’s on your desktop by dragging it to the trash. Turn on your nook. If you navigate to your apps folder, you’ll notice that it’s not there. The only way to find your app is by doing a search. So hit the “n” button on the nook and then “search”. Type in your app name and you should find it. Now you can test your app!

I hope this helps some people. [import]uid: 90878 topic_id: 24855 reply_id: 102305[/import]