Kindle Application Lifecycle
Hello, everyone. Hope you are fine and doing well in your daily routine. Here is the 3rd part of my series of tutorials on Amazon Kindle Application Development. Note : So far we have discussed the following topics in this category.- Amazon Kindle :: An Introduction
- Amazon Kindle Tutorial – Part 1 :: Basic Concepts
- Amazon Kindle Tutorial – Part 2 :: Setting up Your System For Amazon Kindle
- Amazon Kindle Tutorial – Part 3 :: Kindle Application Lifecycle
Active Content
First of all, we need to know what "active content" is. Within the community of Kindle developers, you will hear this term time and again. Active content is nothing but the apps that runs over kindle device. Simply the apps for Kindle, here we call them "active conten”t. Simple it is.Kindlet
Technically, kindlet is an interface in kdk (kindle development kit). We extends its subclass and write our code. At little abstract level, the main entrance of our kindle application is called kindlet. For example like any java program must have a class that contains main() method; to start application from that point (.i.e. via main() method) same in case of kindle app, there must be a class that must extend subclass of kindlet interface (AbstractKindlet class) and hence become entry point of our kindle app. Such class is normally refer as kindlet of our kindle app. In more concise words, if someone asks you where is your kindlet, then it means he/she is asking about the entry point of your kindle application, the class which extends the subclass of kindlet interface of kdk .i.e AbstractKindlet class.Lifecycle of Kindle application
Like every application, active contents have also a defined life cycle. Our application move in between these life cycle phases during its execution and terminates from its exit point. There are four phases application move among. They are- loaded
- ready to run
- running
- shutdown
- create()
- start()
- stop()
- destroy()
{src : kdk documentation}
Lets discuss different phases of life cycleLoaded
When we chose a kindle application to run, its kindlet initialized, along with other static initialization of application. Once this happened, its means kindlet object has been constructed and properly initialized, hence application has LOADED. At this stage, we don’t see any screen/user interface at user end. Its all occurred at backend. At developer lever, we don’t have access to persistent storage; we haven’t access to application environment/context.- After loaded phase, there are two possible ways. Either application will enter in “ready to run” phase or will “shutdown”. In case of shutdown kindlet will not notified.
Ready to run
In case application are eligible for “ready to run” then a transition is occur via method called create() declaired in Kindlet interface. At this stage application gain access to kindle environment and we have a reference of KindletContext object. This object represents the Kindle application's environment for a Kindlet and provides access to the Kindlet's user interface, filesystem space, network connectivity and more. Once a Kindletcreate method has finished, the Kindlet is considered "ready to run". The application's user interface is not visible while in the "ready to run" state and no user input will be received. be patient
The next phase from "ready to run" is to "running". During this start() method of kindlet interface will be called. Even at this point, the user interface is still not visible.
"ready to run" to "shutdown" is also possible. If this occurs, destroy will be called. During destroy, the application should release any resources it has allocated.
Running Phase
The end of start() method moves the application in running state. At this point user interface become visible and application is said to be running state. User can start using application.- Note: one thing need to know. When user plug usb cable to device, then the device goes to screen saver and its stop() method calls for current running application. You can't use device when its plug with usb cable. The
stop()method should pause any executing work, release any file or network resources, and prepare for the user interface to be made invisible. At this stage application move to “ready to run” state again.
Comments (14)
A valid question. Many people has asked the same thing many times. According to them why to spend time (some of them use "waste of time") on such dull old fashioned device where there isn't anything to attract users to first buy it and then use different apps ... they are correct ... kindle seems like a thirty fourty year old invention in first look. No touch no color display (only 16 shades of grey) with eInk surface. In the age of apple's iPad, samsung glaxy an upcoming dell due; kindle simply looks odd man out. So one must think before spending time to develop app for this platform.
But there are few good aspects too for kindle …Kindle is backed by Amazon, a big name. Kindle was a best selling item for Amazon in last quarter and it holds a big market share in its domain (.i.e. ebook reading devices). Color e-ink display has also introduced and amazon is working on feasibility of introducing this feature in kindle. Might we have colored kindle after next year or so ..(Hanvon has implemented color display already) plus if we have touch over kindle then think about a device with such great display even in daylight with touch and color … !!! kindle’s future seems very bright to me .. ☺
I am trying to distribute kindles directly to our customers. We plan to develop applications for them and install them on kindle and then give the kindles to our customers. So, I wanted to know if it is possible to install applications directly on kindle without going the Kindle App Store way? Do we need to get a certification, from Amazon or some other place?
Thanks,
Mayank
By the way,can you send me KDK ?
My email is: losange@163.com
Thanks again for your work!
Matthew scheer
thanks for sharing!
you said in this post that "Its enough for today .. in next part, we will move to actual development, a hello world program"
i have not find that post about hello world program.where the post url?
by the way,your profile picture are very handsome!
hehe!
thanks!
It's a nice post. Are you still doing Kindle development ?
thanks.
Leave a Reply