How to close browser ?

by cuil yahoo » Sun, 20 Feb 2011 06:33:59 GMT


Sponsored Links
 Hey

I am making an app. which uses google authentication. For this, i pass on
intents to the browser and then using the callback method, get the token
back to my application.

The problem i am facing is : After getting the token when i go to my next
activity, and if i click back( which calls finish() ) it goes back to the
browser (which i think did not close but just transferred the token and then
remained in the background ).

I want to display my main activity when i click back . It would be great if
someone could please provide some pointers.

Thank You.
--
Cuil

-- 



Re: How to close browser ?

by Mark Murphy » Sun, 20 Feb 2011 06:45:26 GMT


 


Callback method?


With regards to your subject line, you cannot close the browser. That
is another application -- you have no more rights to close some other
application than other applications have the right to close yours.

Off the cuff, I would think that this sort of authentication would
work better with a WebView widget, so you can control this stuff
better. Then again, I have not tried it.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://github.com/commonsguy 
 http://commonsware.com/blog  |  http://twitter.com/commonsguy 

Android Training in London:  http://bit.ly/smand1 and http ://bit.ly/smand2

-- 


Sponsored Links


Re: How to close browser ?

by cuil yahoo » Sun, 20 Feb 2011 06:58:03 GMT


 Appreciate the prompt response.








To allow the user to authenticate himself, i pass on a url to the browser
using intent. Then when verified the browser returns a token back to a
callback class. This is perhaps easier to use for authentication. I would be
glad to know of other ways as well. (:




Oh...yes, agreed.  absolutely.




i want my previous activity to be shown instead of the browser when i click
back in the newer activity (the one which comes after the authentication).

just wondering : correct me i am wrong, if i say create an intent of my
previous activity and use startActivity (intent_name), all the data stored
in the previous activity would be lost ?


--
Cuil

-- 



Re: How to close browser ?

by Kristopher Micinski » Sun, 20 Feb 2011 14:52:50 GMT


 




How?



-- 



Re: How to close browser ?

by cuil yahoo » Sun, 20 Feb 2011 15:23:13 GMT


 n Sun, Feb 20, 2011 at 12:22 PM, Kristopher Micinski <
krismicin...@gmail.com> wrote:


http://dev.twitter.com/pages/auth#authorization
Under the heading, sending the user to authentication.

https://code.google.com/apis/accounts/docs/OAuth.html#WorkingOauth
Under the heading, Working with Oauth tokens.

It would be great if you could share your perspective on this. I found this
most simple to implement, there are other ways too,

1. Using the Account of the device and authenticate using that, this limits
the user's options of signing in using another account.

2. Using a separate self made UI , for getting User name and Password and
then authenticating using google-api-java client.

I would love to hear about other ways too.


Thanks.
Cuil


--



Re: How to close browser ?

by Kristopher Micinski » Sun, 20 Feb 2011 16:13:50 GMT


 n general, having the standard browser "talk" to your application seems to
be extremely difficult for a number of reasons. If you find a way to do this
that doesn't involve sending the data to the server and retrieving it from
the app, I'd love to hear about it. Does twitter not have an Android API?

Kris

On Sun, Feb 20, 2011 at 2:22 AM, cuil yahoo <cuilya...@gmail.com> wrote:


--



Re: How to close browser ?

by Kristopher Micinski » Sun, 20 Feb 2011 16:15:17 GMT


 ee this page:

http://www.helloandroid.com/content/useful-java-apis-android-applications

<http://www.helloandroid.com/content/useful-java-apis-android-applications>
Kris

On Sun, Feb 20, 2011 at 3:13 AM, Kristopher Micinski <krismicin...@gmail.com


--



Re: How to close browser ?

by cuil yahoo » Mon, 21 Feb 2011 06:04:40 GMT


 ey,


I am trying to use google docs api and i need authentication for the same.

http://blog.doityourselfandroid.com/2010/11/08/oauth-in-java-the-signpost-library/#more-55

Also, i just want to close the browser after i get the intent to another
activity using intent filters, so that when in the next activity i click
finish() i am taken back to my main activity.

I think i got the solution. Thanks for checking this out anyway. ;)


--
Cuil



On Sun, Feb 20, 2011 at 1:45 PM, Kristopher Micinski <krismicin...@gmail.com


--



Other Threads

1. NetCounter v0.6

Hi all,

This list seems to be the right place to make announcements about 
Android applications so... here is mine ;)

I released for 2 days NetCounter v0.6. NetCounter is a simple network 
traffic counter for EDGE/3G and Wi-Fi. It shows your data usage over 
days, months and many more, user-configurable, counters.

Since v0.6, NetCounter is also available under the GPLv3 license.

For more details, please visit http://www.jaqpot.net/netcounter/

Regards,

Cyril Jaquier


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

2. How do I get Current GPS Location?

Hi everyone
Please look at my method which involves retrieving a GPS location
using myManager.getLastKnownLocation("gps").
I am pretty sure that's not how it works.

Can someone please help me?

public void LoadCoords()        {
        TextView latText = (TextView) findViewById(R.id.latText);
        TextView longText = (TextView) findViewById(R.id.longText);
        LocationManager myManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);

        /*
        GeoPoint p = new GeoPoint((int) (47.47 * 1E6),(int) (-122.01 *
1E6));

        Double latPoint = (double) p.getLatitudeE6();
        Double longPoint = (double) p.getLongitudeE6();

        */
        Double latPoint =
myManager.getLastKnownLocation("gps").getLatitude();
        Double longPoint =
myManager.getLastKnownLocation("gps").getLatitude();

        latText.setText(latPoint.toString());
        longText.setText(longPoint.toString());

    }

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

3. SOAP with ksoap2: BasicAuth-Problems

4. How to Show One tab at a time on the screen.

5. Android developer Needed urgently

6. Spinner Selector Help

7. Fails to connect to AP(which didn't support DHCP Service)