Screenshot
In this app example, it shows on how to create a simple e-book type app. First thing to do is study the usability of intent in Java, passing value from main layout to another layout and learn the basic html command.
Code snippet
main layout
public void
onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Bundle b = new Bundle();
String selectedValue = (String)
getListAdapter().getItem(position);
if(selectedValue.equals("Visual Basic
Overview")){
b.putString("vb1", "1");
}if(selectedValue.equals("Visual
Basic Controls")){
b.putString("vb1", "2");
}if(selectedValue.equals("Visual
Basic Fundamentals")){
b.putString("vb1", "3");
}
Intent myIntent = new Intent("vb.android.app.TUTORIAL");
myIntent.putExtras(b);
startActivity(myIntent);
}
});
tutorial layout
mWebView = (WebView)
findViewById(R.id.web1);
mWebView.getSettings().setJavaScriptEnabled(true);
int result =
Integer.parseInt(b.getString("vb1"));
if (result==1){
mWebView.loadUrl("file:///android_asset/Overview.html");
}else if (result==2){
mWebView.loadUrl("file:///android_asset/Forms.html");
}else if (result==3){
mWebView.loadUrl("file:///android_asset/Forms.html");
}
Programming Language: Java
Programming IDE: Eclipse