AddHead(new Html(<<
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://www.google.com"));
startActivity(intent);
Try adding this code to the app you were using for the first tutorial, or try to make a new project for this code. Try to make it so the code executes when you push a button.
EOD )); $page->AddPost(new Post('What else can I intend to do...', <<Let's try to do that (we won't succeed at first, so expect failure). From the original code snippet, replace http://www.google.com with tel:(555)555-1234 and replace Intent.ACTION_VIEW with Intent.ACTION_CALL. Try running the app. When you execute the calling code, you will get an error that says something like "Sorry! The application Hello World (process com.urbanstew.HelloWorld) has stopped unexpectedly. Please try again".
The problem was that the app did not have permission to initiate calls. If you are feeling adventurous and want to learn a little about debugging, go into you operating system's terminal window and enter adb logcat. You will get a long output, and somewhere close to the bottom you will see:
E/AndroidRuntime( 1194): java.lang.SecurityException: Permission Denial: starting Intent { action=android.intent.action.CALL data=tel:(555)555-1234 comp={com.android.phone/com.android.phone.OutgoingCallBroadcaster} } from ProcessRecord{43741e48 1194:com.urbanstew.HelloWorld/10018} (pid=1194, uid=10018) requires android.permission.CALL_PHONE
This friendly error message tells you about the lack of permission to call.
To avoid this error, we need to give the app permission to initiate calls.
After you give the permission, try running the app.
EOD )); $page->AddPost(new Post('Next steps', <<