Querying the standard browser

by oleven » Tue, 09 Feb 2010 01:41:52 GMT


Sponsored Links
 Is it possible to interface with the standard browser?

I would like to know what urls are open in all browser windows/tabs,
maybe the history for each window/tab and finally the position(what
text is visible, scrollbar percent etc.) of each window.

Is this possible?

I've looked at the tutorials for webview, but it only seems to be able
to display a new url. If I could iterate all open windows/tabs as
webviews I think I could get the information out that I'm looking for.

/Ole

--



Other Threads

1. Start Service when phone power up

Hi,

    after i read some posts here in forum, i'm able to start my
program when phone power up. But i need to start a Service, in this
case, the service is a notification, just for testing. Here is my
code.

package com.test.StartupTest;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class TesteStartup extends BroadcastReceiver {

        @Override
        public void onReceive(Context context, Intent intent) {
                Toast.makeText(context, "Test to see if this
works",Toast.LENGTH_LONG).show();

                //Start explicitly a Service that show in Notification bar a 
message
               context.startService(new Intent(context,
NotifyInfoUser.class));
        }
}

and the  NotifyInfoUser.java:

package com.test.StartupTest;

import com.test.R;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class NotifyInfoUser extends Service{

        private NotificationManager mNM;
    private static int MOOD_NOTIFICATIONS = R.layout.main;

        @Override
    public void onCreate() {
        mNM = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
    }

          @Override
        public void onStart(Intent intent, int startId) {
                super.onStart(intent, startId);
                showNotification(R.drawable.online_connected, "Connected");
        }

        private void showNotification(int moodId, CharSequence text) {

        // Set the icon, scrolling text and timestamp.
        // Note that in this example, we pass null for tickerText.  We
update the icon enough that
        // it is distracting to show the ticker text every time it
changes.  We strongly suggest
        // that you do this as well.  (Think of of the "New hardware
found" or "Network connection
        // changed" messages that always pop up)
        Notification notification = new Notification(moodId, "Client
Started", System.currentTimeMillis());

        // The PendingIntent to launch our activity if the user
selects this notification
       //I guess putting null in Intent(this,null) can be crashing....
        PendingIntent contentIntent = PendingIntent.getActivity(this,
0,
                new Intent(this, null), 0);

        // Set the info for the views that show in the notification
panel.
        notification.setLatestEventInfo(this, null, text,
contentIntent);

        // Send the notification.
        // We use a layout id because it is a unique number.  We use
it later to cancel.
        mNM.notify(MOOD_NOTIFICATIONS, notification);
    }

    @Override
    public void onDestroy() {
        // Cancel the persistent notification.
        mNM.cancel(MOOD_NOTIFICATIONS);
    }

        @Override
        public IBinder onBind(Intent intent) {
                return null;
        }
}

and finally my manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest
        xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.test"
    android:versionCode="1"
    android:versionName="1.0.0">

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

    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <receiver android:name=".StartupTest.TesteStartup">
            <intent-filter>
                <action
android:name="android.intent.action.BOOT_COMPLETED" />
                                <category 
android:name="android.intent.category.LAUNCHER" /
            </intent-filter>
        </receiver>

        <service android:name=".StartupTest.NotifyInfoUser"/>

    </application>
</manifest>

When phone power up, the screen with "This app execute a ilegal
operation, etc" appear. When i comment the startService, the Toast
appear in screen. So, what is wrong with the context.startService?
thanks a lot

Breno
--~--~---------~--~----~------------~-------~--~----~

2. setContent(intent) doesn't work in TabHost

I tried to use setContent() to get an activity in TabHost, but it
failed.  The detail codes are followed:


import android.app.Activity;
import android.os.Bundle;
import android.widget.TabHost;
import android.content.Intent;


public class Test extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
                TabHost tabs=(TabHost)findViewById(R.id.tabhost);

                tabs.setup();

                TabHost.TabSpec spec=tabs.newTabSpec("tag1");

                spec.setContent(R.id.tab1);
                spec.setIndicator("$ Dollar ");

        tabs.addTab(spec);


                spec.setContent(R.id.tab2);
                spec.setIndicator(" Pound");
                spec.setContent(new Intent(this, List1.class));
                tabs.addTab(spec);



                tabs.setCurrentTab(0);
    }
}


List1.java is followed:

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

public class List1 extends Activity {

        @Override
        public void onCreate(Bundle icicle) {
                super.onCreate(icicle);
                setContentView(R.layout.cal);
   }
}

cal.xml :

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text"
    android:layout_width="fill_parent"
android:layout_height="fill_parent"
    android:gravity="center_vertical|center_horizontal"
    android:text="hello_world" />


Thank you very much for your help!


--~--~---------~--~----~------------~-------~--~----~

3. GMAIL ON ANDROID...Less then useless.

4. Help_Appreciated: Sample code for getting data from a web server

5. Landscape mode event

6. Can someone with no programming experience learn to develop apps on Android?

7. HTTP proxy, android.net.Proxy, Android 1.0