Android webview and google acount? - android

Hey everyone,
I'm working an app that includes a webbrowser inside.
I've done quite some progress with getting the webview widget to work as necessary, but this thing really puzzles me.
I can't get the webview to forget my google account, even with deleting cache and history, it still remembers it. Which is really annoying since the application will be used by many users on a single device.
Any help very much appreciated

You need to clear cookies too. Use CookieManager to remove all cookies. For example, you can add this to your onDestroy():
CookieManager.getInstance().removeAllCookie();

On top of clearing the cache and history locally, you could just loadUrl for:
https://www.google.com/accounts/Logout
This should make sure the session is ended on Google's end.
Seems like a logical solution to me.

Related

Redirect without invoke onPageStarted

It a sample question, can i redirect to another URL without make onPageStarted invoked?, without edit my java code
it will help me to test my app's security, i hope any one have idea if it possible :).
Thanks
You can try using <iframe> because onPageStarted will not be called when the contents of an embedded frame changes. If this is not a choice for you, I'm afraid there is no way to stop calling onPageStarted.
Another possible way (maybe this is my imagination) is to modify Android source code. To achieve this, you can follow the steps mentioned there. Basically, you need to download Android source, build it, and modify some code (maybe delete onPageStarted). This can be complicated and I'm not sure whether this can work.

change browser home page in android [duplicate]

Within my app, is it possible to programatically change the Android browser's homepage url? If so, how can I accomplish this?
For example, if you run this popular app with Android 2.3 (all that I've tested), it will change your homepage to http://www.searchmobileonline.com
-- https://market.android.com/details?id=goldenshorestechnologies.brightestflashlight.free
Thanks!
I did not try this myself, but BrowserSettings has a public interface setHomePage:
public void setHomePage(Context context, String url) {
Editor ed = PreferenceManager.
getDefaultSharedPreferences(context).edit();
ed.putString(PREF_HOMEPAGE, url);
ed.commit();
homeUrl = url;
}
It is used in BrowserBookmarksPage like this:
BrowserSettings.getInstance().setHomePage(this, [URL]);
But that BrowserSettings class is only accessible from that package. So maybe accessing the shared preferences is easier... ?
MORE...
Not really here to be giving a lesson. It may be possible to do, maybe with some native code accessing the XML file with the preferences for the Browser or other ways like this, but...
No matter what you do, this would be going "around" the security in
place. Your app should not be able to change the homepage of the
Browser (or it would be in the documentation)
Even if it is possible to find a way to do it (through NDK or finding undocumented interfaces), it would most likely stop working at some point with some new release of Android, which is probably not what you would want.
I understand some app already do it, and IMHO, that's bad. Does not mean that your app should be doing the same and frustrate more potential users.
There is NO WAY to change the homepage url of the browser.
com.android.browser opens/creates a preference with MODE_PRIVATE. So the files's attributes are became as -rw-rw----
And also browser app's menifest has no sharedUserId attribute.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.browser">
The app doesn't provide the chance to share app's preference file.
This cannot be accomplished programmatically from within your app.
Edit: I downloaded the application you provided, and it does appear to accomplish what you're looking for. How exactly it was done, I have no clue. I can't find anything online on how to do this. I'm interested to see if anyone has any ideas on how they accomplished this.
I hava a opinion:
Maybe you can read the source code of Browser and find the code like this:
SharedPreferences prefs = mContext.getSharedPreferences(RECOVERY_PREFERENCES, Context.MODE_PRIVATE);
and get the SharedPreferences of Browser,then find the place to set homepage, change it.
Is that possible?
Im guessing the app developer didnt write it in his code to do that. I think one of the 11 ad sdks he has in his app is causing it.
He has
adserver.adview
adwhirl
amobee.onlinehapi
apperhand
google
inmobi.androidsdk
jumptap.adtag
mdotm.android.ads
millenialmedia.android
mobclix.android.sdk
zestadz.android
as a side note this is ridiculous.
I authored the app called My Home Page (https://play.google.com/store/apps/details?id=com.aac.myhomepage) where I needed to accomplish this exact task. I looked everywhere possible and couldn't find a method of doing this so I ended up using two workarounds which really aren't great options in my opinion.
1) I offer a root option for those who have rooted devices where I simply access the SharedPreferences XML file of the browser and, using regular expressions, swap out the value of the home page with the one needed.
2) Copy the URL to the clipboard and tell the user how to accomplish changing the default home page.
Note that I did not use root access without the user's permission nor did I change the home page without the user's permission. This is the purpose of the app and the home page isn't changed without the user explicitly doing so.
I recently noticed that the ad SDKs were doing this but something tells me that they aren't doing it in a proper manner and I don't have any interest i

Swiftkey app does not work inside Webview

So heres the deal: I am getting to know the functionalities of the Webivew in Android and I've been testing with some well known urls and everything works fine. I've also added the onsavedInstanceState and onBackPressed methods to make sure I can go back to the previous page and make sure the page does no reload.
Problem:
Lets say I load the Facebook url and I am posting something, The SwiftKey Dictionary does not show. Is there a way to work around this ?
Thanks in advance.

slideshare in android app

I am new to Android and I am studying the possibility of including/embedding a slideshare slideshow (among other contents) into an Android app.
The idea would be receiving from the user the URL of the resource, such as:
"http://es.slideshare.net/slideshow/embed_code/16060200?rel=0"
And in certain section of the app display the slideshow mixed with other contents (text or whatever...)
I have been searching and the only option I saw (I insist I am really new to this...) would be making a webview for that activity... but... Is a webview fullscreen only? Can it be just part of an activty?
I hope I got to make myself understood... otherwise, let's try to clear it out and ask me whatever you may need to understand the question ;)
Thank you very much in advance,
Miguel
PS: I can accept other systems instead of slideshare, what i want is to embed an slideshow
Sounds like what you need is a WebView, just like you said. They can be non-fullscreen as well. Not sure how much this helps, but here's a tutorial on WebView's from the dev site:
Building Web Apps in WebView

How to change the default Android browser's homepage within an app?

Within my app, is it possible to programatically change the Android browser's homepage url? If so, how can I accomplish this?
For example, if you run this popular app with Android 2.3 (all that I've tested), it will change your homepage to http://www.searchmobileonline.com
-- https://market.android.com/details?id=goldenshorestechnologies.brightestflashlight.free
Thanks!
I did not try this myself, but BrowserSettings has a public interface setHomePage:
public void setHomePage(Context context, String url) {
Editor ed = PreferenceManager.
getDefaultSharedPreferences(context).edit();
ed.putString(PREF_HOMEPAGE, url);
ed.commit();
homeUrl = url;
}
It is used in BrowserBookmarksPage like this:
BrowserSettings.getInstance().setHomePage(this, [URL]);
But that BrowserSettings class is only accessible from that package. So maybe accessing the shared preferences is easier... ?
MORE...
Not really here to be giving a lesson. It may be possible to do, maybe with some native code accessing the XML file with the preferences for the Browser or other ways like this, but...
No matter what you do, this would be going "around" the security in
place. Your app should not be able to change the homepage of the
Browser (or it would be in the documentation)
Even if it is possible to find a way to do it (through NDK or finding undocumented interfaces), it would most likely stop working at some point with some new release of Android, which is probably not what you would want.
I understand some app already do it, and IMHO, that's bad. Does not mean that your app should be doing the same and frustrate more potential users.
There is NO WAY to change the homepage url of the browser.
com.android.browser opens/creates a preference with MODE_PRIVATE. So the files's attributes are became as -rw-rw----
And also browser app's menifest has no sharedUserId attribute.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.browser">
The app doesn't provide the chance to share app's preference file.
This cannot be accomplished programmatically from within your app.
Edit: I downloaded the application you provided, and it does appear to accomplish what you're looking for. How exactly it was done, I have no clue. I can't find anything online on how to do this. I'm interested to see if anyone has any ideas on how they accomplished this.
I hava a opinion:
Maybe you can read the source code of Browser and find the code like this:
SharedPreferences prefs = mContext.getSharedPreferences(RECOVERY_PREFERENCES, Context.MODE_PRIVATE);
and get the SharedPreferences of Browser,then find the place to set homepage, change it.
Is that possible?
Im guessing the app developer didnt write it in his code to do that. I think one of the 11 ad sdks he has in his app is causing it.
He has
adserver.adview
adwhirl
amobee.onlinehapi
apperhand
google
inmobi.androidsdk
jumptap.adtag
mdotm.android.ads
millenialmedia.android
mobclix.android.sdk
zestadz.android
as a side note this is ridiculous.
I authored the app called My Home Page (https://play.google.com/store/apps/details?id=com.aac.myhomepage) where I needed to accomplish this exact task. I looked everywhere possible and couldn't find a method of doing this so I ended up using two workarounds which really aren't great options in my opinion.
1) I offer a root option for those who have rooted devices where I simply access the SharedPreferences XML file of the browser and, using regular expressions, swap out the value of the home page with the one needed.
2) Copy the URL to the clipboard and tell the user how to accomplish changing the default home page.
Note that I did not use root access without the user's permission nor did I change the home page without the user's permission. This is the purpose of the app and the home page isn't changed without the user explicitly doing so.
I recently noticed that the ad SDKs were doing this but something tells me that they aren't doing it in a proper manner and I don't have any interest i

Categories

Resources