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. Menus in SDK 0.9

Hello,
I read that menus are one of the improved areas in the new SDK.
I'm trying to do some example I found, but doesn't seem to work, as
the code is for the m5 SDK.

So, I read Android Docs online, and I tried this:

1) Override onCreateOptionsMenu()

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
                super.onCreateOptionsMenu(menu);
                menu.add(0, Menu.FIRST, Menu.FIRST, R.string.options_label);
                MenuInflater mi = new MenuInflater(getApplication());
                mi.inflate(R.layout.options, menu);
                return true;
    }

2) Create OPTIONS.XML layout (R.layout.options) with a linearlayout
containing 2 checkboxes in it.

I run this code and it warns me that the app closed unexpectedly.

Question: Do I have to create some openOptionsDialog() to associate to
the menu? If so, HOW?
In the m5 example, there was a Menu.Add() overload that included a
parameter to pass a Runnable() to the menu, but in 0.9 can't find it.

Thanks in advance,
Tony

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

2. Download Manager, filesupport ??

Not sure if this is the right place, but I have a (simple?) question
about the Download Manger integrated in the 0.90 SDK Emulator.
Soo, I tried, just to familiarize myself with my common use of a phone
on Android, to surf 'the web' a bit, downloading some pictures, little
bit of messing around, i.e. just playing. (and so far I like it :D )
However, when I tried to download a ZIP file, the download manager
refused to download it, giving the following 'error':

"<Unkown>
download2us.softpedia.com
Cannot download. The content being downloaded is not supported on the
phone."

Uh, what? First, no ZIP support? Why no ZIP support?
Second, why won't it download the file, or at least let the user be
able to force the download it, by e.g. a "Download Anyway" button that
appears when you 'long-press' it.

I hope I am missing some hidden options or something, because, if it
is true, that there is a very limited amount of files I would be able
to download, I'd consider that a MAJOR drawback.

Anyone that can comment on this 'problem'?

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

3. android dont avoid

4. Googlephone [HTCdream]: HW testing and what about Italy?

5. Errors when trying to build an example from a guide...how can I resolve.

6. app>dialog>textentry getting the EditText values

7. JOIN New Google Group: Android-Freeware!