I am developing in Android, I am using instrumentation to test Phone application. Instrumentation is Android env to test applications.
For that I use am command wi
you can pass a data uri, mime type and even "extras" to the am command.
am [start|instrument]
am start [-a
] [-d ]
[-t] [-c [-c ] ...]
[-e
[-e...]
[-n] [-D] [ ] am instrument [-e
] [-p ] [-w]
You could pass them as "extras" and then get the extras that are passed to it.
You would pass them like this:
am start -a android.intent.action.VIEW -c android.intent.category.DEFAULT
-e foo bar -e bert ernie -n my.package.component.blah
then in your code:
Bundle extras = this.getIntent ( ).getExtras ( );
if ( extras != null ) {
if ( extras.containsKey ( "foo" ) ) {
Log.d ( "FOO", extras.getString ( "foo" ) );
} else {
Log.d ( "FOO", "no foo here" );
}
if ( extras.containsKey ( "bert" ) ) {
Log.d ( "BERT", extras.getString ( "bert" ) );
} else {
Log.d ( "BERT", "Bert is all alone" );
}
} else {
this.setTitle ( "no extras found" );
}