android "blog app" using phonegap

27 views
Skip to first unread message

Nathan Freitas

unread,
Dec 31, 2008, 1:37:53 PM12/31/08
to phon...@googlegroups.com
Hey there folks. Hope everyone as a great 2009 and that the phonegap progress and excitement continues to grow....

I just wrote up a quick blog post on a new Android demo app I released that is basically my blog as a downloadable. Sort of silly and midly shameless, but the point was to demonstrate that you can hook up a web CMS into a native app.

Here's the post link: http://openideals.com/2008/12/31/wtfblogapp/

I also solved the "supporting links without opening an external browser" issue on Android using the following code:

I just implemented my own WebViewClient and tell the view to load the URL directly instead of launching an the browser app:



 final class MyWebViewClient extends WebViewClient {

     
       
        /* (non-Javadoc)
         * @see android.webkit.WebViewClient#shouldOverrideUrlLoading(android.webkit.WebView, java.lang.String)
         */
        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
           
           
            view.loadUrl(url);
           
            return true;
        }

       
    }


Then in the onCreate() method, make sure to set your client:

 MyWebViewClient webvc = new MyWebViewClient();
  appView.setWebViewClient(webvc);
 
Not sure if there is a similar solution for iPhone, but it works fine on Android.

+n     
       



Matt Gifford

unread,
Jan 2, 2009, 4:09:42 AM1/2/09
to phonegap
Your "external browser" fix works for me. Please contact the
maintainers about getting this fix rolled into the repository.

On Dec 31 2008, 10:37 am, "Nathan Freitas" <nathanfrei...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages