Monthly Archives: April 2011

Understanding GUI in android

Today, I talk about LinearLayout in android, you see this result !!!
and I have homewrk for you.

Later post, I going to show solution for you.

Advertisements

Read pdf file with google docs in Android

Hi Newbie for Adnroid,
Today, I show you how to read a pdf file from internet. It realy easy, so I hope you funy with it.
The first:
you go to adress : http://docs.google.com/viewer, and after that you enter link path that contaner document (pdf file).
for example : I have the document with link path is : http://www.mad-ip.eu/files/reports/Android.pdf, I paste it go to text box in below website then I received a link, it’s :
http://docs.google.com/viewer?url=http%3A%2F%2Fwww.mad-ip.eu%2Ffiles%2Freports%2FAndroid.pdf

The second :
you must create a project, and in java file you can be insert flowing content :

public class program extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.main);
        WebView webview = new WebView(this); 
        setContentView(webview); 
        webview.getSettings().setJavaScriptEnabled(true); 
        webview.loadUrl("http://docs.google.com/viewer?url=http%3A%2F%2Fwww.mad-ip.eu%2Ffiles%2Freports%2FAndroid.pdf");
    }
}

Finally
You must difine user permission for this application in AndroidManiFest.xml file, ok :
it here :

 android.permission.INTERNET 

Run program,we have this result :

Tam Mao … sharing !!!