I want to know to get browse history on android ?

by eaindra nilar » Thu, 03 Sep 2009 09:15:17 GMT


Sponsored Links
 Thank
Sorry,
 I mean, I want to pull out web histroy from content provider  for my
application.



I have some coding. But I got exception .

So, how can I do ?please help me.
Here are my coding
package com.app.browser;


import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.SimpleCursorAdapter;



public class BrowserApp extends ListActivity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.list_activity_view);
        //Cursor
browserinfo=android.provider.Browser.getAllVisitedUrls(getContentResolver());

        String []proj= new String
[]{android.provider.Browser.SearchColumns._ID,
                android.provider.Browser.SearchColumns.DATE,
                android.provider.Browser.SearchColumns.SEARCH};
        Cursor results=

managedQuery(android.provider.Browser.SEARCHES_URI,proj,null,null,
android.provider.Browser.SearchColumns.URL+" ASC");
       /* if (results.moveToFirst())
        {
            do {
                DisplayTitle(results);
            } while (results.moveToNext());
        }


    }
    public void DisplayTitle(Cursor c)
    {

Toast.makeText(this,"url:"+c.getString(0)+"\t"+"search:"+c.getString(1)+"\t"+c.getString(2),Toast.LENGTH_LONG).show();

    }*/

        ListAdapter adapter = new SimpleCursorAdapter(
                this, // Context.
                android.R.layout.two_line_list_item,  // Specify the row
template to use (here, two columns bound to the two retrieved cursor rows).
                results,                                    // Pass in the
cursor to bind to.
                proj, // Array of cursor columns to bind to.
                new int[0]);                                 // Parallel
array of which template objects to bind to those columns.

        // Bind to our new adapter.
        setListAdapter(adapter);

        }
    }

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



Other Threads

1. How to return non-table-oriented data from a content provider

I'm writing a content provider that returns data about game sessions.
This data comes from an SQLite table. However, the client that
consumes it will also want summary data: total wins, current/best
winning streak, and so on. I'm not sure which approach to use.

* Possible Approach 1: Do nothing, let the client calculate what it
needs.

The client could step through the whole table and calculate statistics
itself. However, it's inefficient to send the entire database over the
content provider link if the client only wants the summaries; this may
also be prone to bugs because each client has to reimplement the
summary calculations.

* Possible Approach 2: Separate content URIs for summary data.

The client could ask for a URI like content://myapp/summary/totalwins
and get back a text/plain stream containing the number of wins. This
seems like a big hassle to implement on both ends, though. Or it could
ask for a URI like content://myapp/summary and get back an XML stream
containing all the summary data, but this isn't much simpler.

* Possible Approach 3: A phony table.

The client could ask for a URI like content://myapp/summary and get
back a cursor over a single row, with each summary value having its
own column. This would not be an SQLite cursor but a custom in-memory
cursor. It seems a little unnatural to use a table metaphor when
there's always exactly one row, though.

* Possible Approach 4: The extras bundle.

Cursor has a getExtras() method that returns a bundle. The client
could make a request for the main URI, content://myapp/sessions, and
then just look at the extras bundle instead of reading any rows.
However, there's no setExtras() method, so I'm stuck with whatever
bundle object SQLite puts in there - and if it's Bundle.EMPTY, I'm out
of luck.

What do you recommend?

Jesse
--~--~---------~--~----~------------~-------~--~----~

2. Do Android devs work on Android products full time or part time?

On Fri, Mar 27, 2009 at 10:41 PM, admin.androidsl...@googlemail.com



Me too, at least not at this stage. I'm working as hard as I can on
many other projects, trying to gather as much money as possible, so
that at some point in the future I can "retire" developing app after
app after game after app for every possible mobile OS on the world,
and finally retire at 40 ;)


+1 for waiting kid to bed (and wife! ;) by which point I am pretty tired :(


I'm not counting on 1 app to make me rich, ever. Making a whole lot of
apps (provided you have the imagination and skills to develop them) is
the way to go (I think).


What's not? Changing job is also risky. Getting married too ;) Having
kids, etc. ;)

Cheers

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

3. Please suggest Substitute for drawRegion in android.

4. Reconnect adb while emulator is running

5. Seek meaning of luni

6. Ascii codes of shifts

7. That other phone