Thursday, May 30, 2013

Android Tip - Resolving Build Issues in ADT v22


For those of you who have recently upgraded to the latest version of the Eclipse ADT Plugin (v22), you will realise that some of your projects may be failing to build correctly, specifically those of you who use the Android Support Library

In ADT v22, the Android Support Library is now in the Android Private Libraries section:


The problem is that ADT v22 does not automatically include the libraries in the Android Private Libraries for compilation. And this will cause your project's failure to build correctly. 

To solve this, right-click on the project in Eclipse and select Properties. Select Java Build Path and click on the Order and Export tab. Check the Android Private Libraries and click OK. Clean your project and it should now work. 

Monday, May 20, 2013

Confirmed Courses in June and July 2013

I am happy to confirm the following courses! For the list of complete courses, please check out the link here.



S$997/pax



4-5 Jul
(Thu-Fri)








S$997/pax


24-25 Jun
(Mon-Tue)






S$599/pax


26 Jun
(Wed)








Thursday, May 16, 2013

Android Studio is the future of Android Development!

I am excited to announce a 1-day Preview of the newly announced Android Studio!

Android Studio is Google’s new IDE for creating Android applications. Based on the powerful and extensible IntelliJ IDEA Community Edition, Android Studio is designed specifically for Android development. With Android Studio, Android developers now have a dedicated tool that is designed from the ground up, providing you with simplified workflow and tools for designing world-class Android apps. Android Studio is now available for download as an early access preview. This is a good chance to learn about Android Studio and prepare for the future!

Download course outline and application form here.

Venue
Bayview Hotel
30 Bencoolen Street
Singapore 189621

Date
11 Jun 2013 (Tue)

Time
9am to 5pm

Fee
S$599

Friday, May 03, 2013

Android Tip - Displaying a PDF Document inside a WebView


One of the most requested features in Android is the ability to display a PDF document within a WebView. However, the WebView does not contain a PDF plugin that allow you to display a PDF document. One solution is to use an Intent object to launch a third-party app (such as Adobe Acrobat) which can handle the PDF document. However, this will transfer control over to the thrid-party app.

If you insists on displaying the PDF document within your own activity using a WebView, you can use the following trick. You can use Google Docs to open your PDF document and then load the URL of Google Docs using the WebView.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);
        WebView webView=new WebView(MainActivity.this);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.getSettings().setPluginState(PluginState.ON);

        //---you need this to prevent the webview from
        // launching another browser when a url
        // redirection occurs---
        webView.setWebViewClient(new Callback());
       
        String pdfURL = "http://dl.dropboxusercontent.com/u/37098169/Course%20Brochures/AND101.pdf";
        webView.loadUrl(
"http://docs.google.com/gview?embedded=true&url=" + pdfURL);

        setContentView(webView);
    }

    private class Callback extends WebViewClient {
        @Override
        public boolean shouldOverrideUrlLoading(
                WebView view, String url) {
            return(false);
        }
    }

The loaded PDF document will look something like this:



Remember to add in the android.permission.INTERNET permission.

Come join me in the Android Post-Conference workshop on 31 May 2013 at DevTeach 2013, Toronto.