user3458065
user3458065

Reputation: 13

Get latest content from websites in android app

I want to get the content to be displayed in my android application as soon as it is updated on a particular website. how can I do that? I'm new to android development....please help

Upvotes: 1

Views: 59

Answers (3)

Silambarasan Poonguti
Silambarasan Poonguti

Reputation: 9442

You can display the web content using these ways,

  1. Through cross platforms, such as PhoneGap with jQuery Mobile or Sencha touch etc,.
  2. Through Android WebView class.

If you try to display a web content using Android WebView class, refer this sample tutorial.

Upvotes: 0

Jitesh Upadhyay
Jitesh Upadhyay

Reputation: 5260

Hi you can use WebView for this purpose please have alook as the example is given below

res/layout/main.xml –

<?xml version="1.0" encoding="utf-8"?>
<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webView1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
/>

the WebViewActivity.java is as follows

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

public class WebViewActivity extends Activity {

    private WebView webView;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview);

        webView = (WebView) findViewById(R.id.webView1);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadUrl("http://www.google.com");

    }

}

do not forget to have permission at manifest

<uses-permission android:name="android.permission.INTERNET" />

Upvotes: 0

Alex Gaber
Alex Gaber

Reputation: 11

sure use WebView - Android documentation here: http://developer.android.com/reference/android/webkit/WebView.html

You can also consider using PhoneGap and make a hybrid native html5 app.

Upvotes: 1

Related Questions