Click here to Skip to main content
15,886,805 members
Articles / Mobile Apps / Android

An Adventure in Porting a Java Applet to Android with no Previous Experience with Android

Rate me:
Please Sign up or sign in to vote.
4.67/5 (16 votes)
17 Oct 2011CPOL10 min read 122.3K   5.2K   37  
Impact Physics walkthrough
package com.korsbergtools.ImpactPhysics;

import com.korsbergtools.ImpactPhysics.R;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class WebViewHelp extends Activity 
{
	WebView mWebView;

	// Called when the activity is first created.
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview);
        
        mWebView = (WebView) findViewById(R.id.webviewhelp);
        if (mWebView == null)
        {
        	System.out.println("Could not load webviewhelp");
        }
        else
        {
	        mWebView.getSettings().setJavaScriptEnabled(true);
	        //mWebView.loadUrl("http://www.google.com");
	        mWebView.loadUrl("file:///android_asset/about.html"); //this loads the browser and view the file
        }
	}	//onCreate
	
}	//WebViewHelp

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
During working hours is a real time firmware developer for custom ASIC's in embedded systems. Writes C/C++/C# code in his sleep and is moderately proficient in Java, Python, hardware description languages and other obscure domain specific languages. Deals with nano/microsecond data propagation delay paths, cache line hit/miss ratios, multicore asic design, etc.
However for fun likes to dabble in the new technologies of the day and deals at higher level software engineering aspects.

Comments and Discussions