Recently changed documents

Click on the link above to see more..

Whats the difference between Green tea and Regular tea?

More documents like this are at:  Health

14-Mar-13

Whats the difference between Green tea and Regular tea?

A simple framework for processing forms in Android

More documents like this are at:  Android Basic UI

8-Mar-13

A simple framework for processing forms in Android

Is there a better way to handle forms in Android

More documents like this are at:  Android Basic UI

8-Mar-13

Is there a better way to handle forms in Android

A quick refresher on CSS selectors

More documents like this are at:  CSS

8-Mar-13

.question {font-weight: bold } (solitary class selector)
p.question {font-weight: bold} (regular class selector)
body {font-weight: bold} (element selector)
p#question { font-weight: bold} (ID selector)
ul li strong  {font-weight: bold} (descendent selector)
ul.mylist li strong {font-weight: bold} (descendent selector for a class)
ul#mylist li strong {font-weight: bold} (descendent selector for an ID)
div>p {} (child selector)
a {}
a:link {} (psuedo selector)
a:visited{}
a:hover{}
a:active{}
p:first-letter {} (psuedo selector)
p:first-line {}
h1:before {}
h1:after {}
h1, h2, h3 {} (Group selectors)
p.introduction:active, hover,  focus {} (Dynamic psuedo selector)
p:first-child {}
strong + em {} (adjacent selector)
(some-selector) a[title] (attribute selector)
(some-selector) a[title="somevalue"] (attribute selector)

"despite" is a good word

More documents like this are at:  Humanities Current

5-Mar-13

Words come in many colors.
Some are meek.
Some are shy.
Some are stylish.
Some have substance.
Among those that are strong and essential,
"despite" is a good word.

In the family of
deeply unpleasant creatures
when I descry a sprite
I will name it "despite".

Architecture

More documents like this are at:  Humanities Current

5-Mar-13

To move without moving,
To classify without categorizing,
To reach without travelling,
To permeate as presence does,
Architecture is the art of absence.

Progression of another malaise

More documents like this are at:  Health

1-Mar-13

Progression of another malaise

What should inspire you?

More documents like this are at:  TED

1-Mar-13

What should inspire you?

On Joy

More documents like this are at:  TED

1-Mar-13

On Joy

On Education

More documents like this are at:  TED

1-Mar-13

On Education

How can I do *essential* chores when I don't want to?

More documents like this are at:  TED

1-Mar-13

How can I do *essential* chores when I don't want to?

How do I start?

More documents like this are at:  TED

1-Mar-13

How do I start?

What is electric-cloud and its competitors?

More documents like this are at:  Android 1.5

1-Mar-13

What is electric-cloud and its competitors?

If I don't pay attention at home entropy seem to take over the router and modem quite frequently. I am needing to restart the router and modem quite frequently. That is when I realize it. Not sure how many times I don't even notice.

otherwise I am getting speed tests of 3mbps. when I restart the router I get 20mbps. These are relatively new and expensive router and modems from motorola and linksys.

A quick snack

More documents like this are at:  Recipes

5-Feb-13


Cucumbers
Olive Oil
Salt
Black pepper
Lime
Chopped Parsley/Cilantro
A large bowl

Reluctant Spinzone: Key Self Help Articles

More documents like this are at:  00.15-Research

2-Feb-13

Reluctant Spinzone: Key Self Help Articles

We have started work on Expert Android for APress

More documents like this are at:  Android 1.5

26-Jan-13

Here is the tentative TOC for the book

01. Custom Views 
02. Compound Views 
03. Custom Layouts 
04. Using JSON for On-Device Persistence 
05. Programming for multiple devices 
06. Apps Security Techniques/Patterns 
07. Table Views/Scoll View Techniques 

08. Advanced Debugging and Analysis 
09. Programming in OpenGL ES 2.0 for Android
10. Android Search User Experience 
11. Android Search Providers 
12. Android Search Custom Providers

13. Using the Telephony API 
14. Near Field Communication (NFC) 
15. Google Cloud Messaging for Android 
16. Cloud storage for Applications: Parse.com 
17. PhoneGap 

18. JQuery Mobile 
19. Enterprise Security 

//Last 5
20. Monetization Techniques 
21. App Performance Optimization and Tuning 
22. Couch DB 
23. Bluetooth APIs 
24. IBM Worklight Mobile Platform 

Lensey Namioka

More documents like this are at:  Books

24-Jan-13

I have been meaning to read this book when I get a few minutes. Narayan brought home this book. I have read a couple of lines. it is funny and well written.

Click on the link above to see who Lensey is and what other books she wrote.

Reading Walden Pond

More documents like this are at:  Humanities Current

19-Jan-13

Reading Walden Pond

A walk with out a Camera! My Aldo Leopold Moment!

More documents like this are at:  Humanities Current

19-Jan-13

Click on the topic above for the full story

A Sapling's Choice

More documents like this are at:  Shells: My Writes

16-Jan-13

Dawn has brought a beautiful morning to the Heavens.
Almighty on his throne was in a good disposition.

"A Forest of Oaks,
Regal, Tall and Stately,
Or A Metropolis of Humans,
Untethered, where they Think, Move and Fly,
Would you like to be planted!"
He so asked a Sapling!

The Sapling replied
"Dear beloved father,
Plant me in a Desert,
That I may know not any limits"

Parse.com
Cocoafish - Appcelerator now
Stackmob
Applicasa

Identity

More documents like this are at:  Shells: My Writes

9-Jan-13

I am so odd and different,
That I am glad in this Land where
I have no crisis that is named Identity!
I am glad it has no name or shape or form in this land.
With my blots and blemishes,
Thoughts and twisted limbs,
I am glad I have so many
Profound things that I think of,
But never of identity.
Like trees in a crowded forest,
I am glad to push and shove,
Twist and turn,
Crawl and climb,
To seek the Sun,
Unaware of my shape and limb.
I am so glad Identity is not my crisis!

How to publish from google to youtube

More documents like this are at:  Computer Hardware

7-Jan-13

How to publish from google to youtube

Taking stock of 2012

More documents like this are at:  Humanities Current

3-Jan-13

Likes and dislikes of 2012.

Ivy of Sadness

More documents like this are at:  Shells: My Writes

30-Dec-12

Are we what we are given?
When I look back
some have struggled to become Paupers
and some Potentates,
like pre-disposed leaves blown in a genetic wind,
in apparent delusion of self-determination.
Could we really change who we are?
Could we really make the right choices?
Could we discipline our mind to see the truth,
And when not the courage and conviction to forgive ourselves!

Perhaps, as a collective human race,
we are at a stage to finally understand
and solve this quagmire called human mind.

To discipline, 
To Rein in,
the goalless neurons,
to a determined purpose,
I pray be possible,
not necessarily by medicine,
but by that called WILL,
and an ample dose of repeatable Science.

GSON JSON for Mobile App Storage

More documents like this are at:  Android Data Storage

28-Dec-12

You will be surprised how GSON can propel your mobile app productivity especially release 1 candidates. In this approach you will represent the persistent state of your apps as JSON. You will use the "Beautiful" tool called GSON from google to convert your application objects to JSON and persist the resulting JSON string either in a shared preference or on internal storage as files.

This approach is really suitable for writing apps really quick. It is not unreasonable to release apps with in 1 to 2 weeks once you get seasoned at this. This would probably take a month or two otherwise. You may get a 2 to 3 times advantage on simpler apps.

Even when you consider complex apps you may get significant advantage while you are prototyping the idea and test it out on a limited release.

This semi article which will eventually be part of our upcoming Expert Android book documents the necessary elements and present the code snippets and answers the questions I ran into as we researched this topic.

This article answers the following questions


What does Android recommend for data storage options? The Official line!
The JSON solution
What is GSON?
  What is GSON's homepage?
  Is there a user guide for GSON?
  Can I save nested objects?
  Can I save nested collections of objects?
  How are characters in strings escaped?
How do you add external jar files to Android APK file?
What are shared preferences?
Difference between getSharedPreferences and getPreferences?
How to get a context independent of an activity?
Where are shared preference files stored?
How do you save JSON to a shared preference file?
What does the saved preference file look like?
How do you read JSON from shared preferences back as Java Objects?
How does escape characters work in android preferences?
What is internal storage?
How do you save to internal storage?
How do you restore objects from internal storage?
Should you use external storage like the SD card?
What are the useful references while working with this approach?
How do you code such a way that you can migrate in the future to SqlLite?
What Next?

Myriad colors of Shared preferences

More documents like this are at:  Android Data Storage

27-Dec-12

There are 2 intended purposes for shared preferences in Android. First of these is a persistence mechanism to quickly remember user preferences for android apps. In that context Android has a declarative framework for generating the UI and also the persistence of the values chosen in the UI.

The second use is an extension of the first minus the UI. In this context preferences are merely key/value pairs that are stored by the application at any point of its life with no constraints of the UI.

Inventive programmers have finagled the second usage pattern to store arbitrary java objects as JSON strings and persist them using the preferences key/value pair APIs.

See the ProAndroid series to understand the first two usage patterns well. The book also shows how home screen widget state can be maintained in preferences.

In the upcoming Expert Android book I am going to write about the unintended, but quite useful, json usage pattern using the shared preferences.

This article is a quick rehash of the links and the code snippets that I am collecting which in due time will make their way to the Expert android book.

Storage data options for Android apps?

More documents like this are at:  Android Data Storage

26-Dec-12

I started this research article to answer the following questions: what are the limitations of using shared preferences as data storage for simple apps and games? is there an official word not to use them for more than simple key value pairs? is there a maximum limit to the amount of data that can be stored using this scheme? Should I explore other data storage options? What does it mean by internal storage and external storage? Should I instead use files to save my dynamic data?

Although there is sqllite resident on android, it is lot of work to go between java objects and a relational database. Even in the simplest case of using wonderfully crafted o/r mapping tools or libraries, it is still lot of work. So I looked for a work around. This led me to use gson/json combination to go between java objects and json strings. These strings can then be stored in shared preferences. Some of my colleagues have tested this and found it really working well for 10s of kilobytes of data. This is quite sufficient for simple games and apps.

Here is what I found

There are 5 ways to data storage in Android: 1) shared preferences 2) internal files 3) external files 4) sqllite 5) network storage in the cloud.

shared preferences are internal to the application and device. this data is not available to other applications. User cannot directly manipulate this data by mounting on to a usb port. this data is removed automatically when the application is removed.

internal files is very similar to shared preferencces except that these are standalone files that you can write to with out any predefined structure. Shared preferences is structured key/value pair data and follows a few other semantics imposed by Android for using them as preferences. I suppose I could easily switch to internal files from shared preferences as they are pretty close. Importantly I haven't found a "compelling" or "impending" reason to swtich with urgency.

external files are stored on the sd card. these become public files that other apps incuding the user could see outside the context of your application. For my app I don't believe this is applicable the data doesn't make sense outside of the context of the application. These are not user created images or documents that the user want to see independently. I may go this route if I had been storing data in the order of 10s of megabytes. this is not the case so I am not constraining the device significantly.

Sqllite is good but I don't have the bandwidth to go through the cumbesome coding for release 1. For subsquent releases this is an excellent option as I can be much faster and use much less power. this is the ideal state. but if the app becomes really popular we will take this step. However one must code so that this switch can happen with minimal change to the rest of the application. One way to do this is to have an explicit service layer that separates persistence aspects completely outside of the logic. These databases also are private to the application and not available to the outside apps.

Network storage is not an option at all as I need the app to work when disconnected. There may be suppplemental opportunities to use parse.com or a similar BAAS (Backend as a service) platform to do some of that.

Hope this helps someone else out there in the cloud as well.

So the bottom line is I am going to stick with the shared preferences, gson/json for release 1. Internal file storage is a reasonable good behavior. But I am not compelled to be good so quickly. Go to sqllite in a year or two if it gathers GOOD moss.

See the rest of the notes for links and supporting research.