Android Intent


Sample Packages and Techniques used with Android

Omar Flores

Credits: 

- 6. Icon from NASA, music from Holy Cross Church Choir.

- 5 TooDo: by Edouard Mercier.

- 4. Assets3: 

 Zach Hobbs: for pointing me in the right direction and for his tutorials. 

The Java Developers Almanac  for superfast code to copy files.

M3 to M5 Porting and Migration tips. For highlighting the bumps in the road in the challenge. 

List of All functions in Android for an overview of what Android is (m3 though)

- 3. Psalms13:

SqliteCommands 

PsalmsPublic

- 2. Read/Write: codeSnippet 

- 1. Tutorial and tools: droiddraw.org.

Create the layout

 - This package uses portions of  NotePad app:

NotePad


List of Packages / Techniques:

7. Fast db copying (as found in the Java Developers Almanac): It is available now at android-developers Mail Archive

6. Psalms of King David This applications allows you to read the Psalms in your android phone.  Search the psalms by word / words or by phrase.  Sample Screen (click on it to enlarge it)

[To enter comments / requests / feedback please use the blog for this application at HelloAndroid]

 Song: Litany Of Loretto (Praises to Virgin Mary)

Application:   psalms.apk   

(created with android-sdk_m5-rc15_windows)

Usage:

More sample screens:

Search screen: Search.jpg 

List screen: List.jpg 

Song: LitanyOfLoretto.jpg 

Help: Help.jpg

1. Sample usage:

1.1 To display psalms that have the word: Lord in them, just enter Lord

1.2 To display all the psalms: don't enter anything and press Search

1.3 To display the first line of every psalm: enter :1[space]

1.4 To display the psalm 1 alone: enter [space]1: 

 Additional notes:

Using this apk on the emulator:

PsalmsOnEmulator

Known Issues:

1. Entering ' in the search causes an application error.  Please don't use ' for now.  A fix will be issued to address this.

5. Other apks:

 An apk that allows you to stay organized, by Edouard Mercier.

http://edouardmercier.fr/toodo/download 

Notes: 

- TooDo has been enhanced to use geolocation reminders in the last version 1.6

- Fixed issues: the date picker use to have a problem: for Monday Apr 21 it shows Monday Apr 22 as showing in the below capture.  (However, in Android | API demos the picker is OK.)  The issue has now been resolved.

wrongdate.jpg

 

4.assets: Package that implements getAssets() to distribute a sqlite db via assets folder and to paste it to the /data/data/YourApp/databases folder.  It takes a very short time to handle a 300kb file: about 2 seconds.  It shouldn't take too long when deployed in the Android phone, hopefully ;-)

Assets3.zip

3. Psalms13: reads from a text file and writes to sqlite db.

 Psalms13.zip

3.1 The text file was created with Psalms of the public domain:

CompleteNoTab.txt

A series of delimiters help the process of parsing using charAt(index) and string.substring(startindex, endindex).  In order to remove the tabs that Excel puts when saving: File Replace: tab with nothing.

The resulting file can be placed in the /data/data/package/files folder with adb push CompleteNoTab.txt /data/data/com.p13/files/CompleteNoTab.txt

The package runs for about 2min and at the end the sqlite db is populated with the 150 Psalms:

sqlitedb:   psalmsdb

Notice that the four fields are: ID, Psalm#, PsalmText, and IsTitle.

In order to push the db for distribution:

adb push psalmsdb /data/data/com.google.android.notepad/databases/psalmsdb


2. Sample app that writes to a file in data/data/yourAppPackage/files and reads from it.  It compares the two strings and sends the result to the log (that can be invoked with adb logcat > log.txt).  The file in ../files can be read with cat samplefile.txt

Complete package: writing2.zip

1. Sample app that uses a table layout, linear layout and a sqlite database to store names, phones and email.

Complete package: droidTable.zip

Here is a screen capture of the user interface:


 

 

 

Updates: 

2/5/09  Other links that display the fast db copying approach.

6/13/08 Updates on the TooDo app. 

6/13/08 Psalms of King David: issue with '. 

4/22/08 Other apks. 

4/14/08 Usage samples.

4/11/08 Apk posted. 

4/9/08 Help on Psalms posted. 

3/27/08 Fast way to copy a db file from assets to  a given folder.

2/29/08  Page revision.

2/27/08 psalms13.zip uploaded 

2/15/08 writing2.zip uploaded.

2/5/08  droidTable app uploaded

2/4/08 droidTable app tested and packed.