How to use WebView in Offline mode? Can I dynamically revoke permissions?

by Mariano Kamp » Wed, 21 Apr 2010 02:17:51 GMT


Sponsored Links
 Hi,

I am want to use JavaScript to process some HTML pages in the background.

WebView seems to be a great basis to do this. There is one issue though. I
don't want to display the web page and its images/stylesheets right away, so
it is a waste of bandwidth when the stylesheets and images are downloaded. I
am wondering how to tell WebView not to do that.

I tried WebSettings.setLoadsImagesAutomatically(false), but this still loads
the stylesheets. WebView.setNetworkAvailable(false) is more an information
for WebView than a switch. Overriding
WebViewClient.shouldOverrideUrlLoading(..) didn't work either.

Any idea how to do this?

One thing that works is not giving the app the required Internet permission.
Unfortunately it is not that simple, because at other times I want to
display the processed pages and then it should download the
images/stylesheets ;-( But still is there some way that I can use this
permission thing? Can I dynamically revoke the permission? For a single
thread or process?

Cheers,

Mariano

--



How to use WebView in Offline mode? Can I dynamically revoke permissions?

by Mariano Kamp » Wed, 21 Apr 2010 03:39:17 GMT


 >




Sounds good. I will try that.

--


Sponsored Links


Other Threads

1. Emulator startup

Hi

When I start the Emulator from doing "Android" via command line and
then starting a AVD via startup API 7, then I get the following log
via logcat. Essentially, the emulator just stays the way it with
flickering "ANDROID" and nothing else. I can't load anything on it.
Additionally, Is there a way to start AVD which is is quicker to bring
up and less buggy?

Thanks for your help,
Arvind


10-05 22:02:49.914: ERROR/vold(26): Error opening switch name path '/
sys/class/switch/test' (No such file or directory)
10-05 22:02:49.914: ERROR/vold(26): Error bootstrapping switch '/sys/
class/switch/test' (No such file or directory)
10-05 22:02:49.914: ERROR/vold(26): Error opening switch name path '/
sys/class/switch/test2' (No such file or directory)
10-05 22:02:49.914: ERROR/vold(26): Error bootstrapping switch '/sys/
class/switch/test2' (No such file or directory)
10-05 22:05:17.345: ERROR/BatteryService(93): usbOnlinePath not found
10-05 22:05:17.393: ERROR/BatteryService(93): batteryVoltagePath not
found
10-05 22:05:17.393: ERROR/BatteryService(93): batteryTemperaturePath
not found
10-05 22:05:17.823: ERROR/SurfaceFlinger(93): Couldn't open /sys/power/
wait_for_fb_sleep or /sys/power/wait_for_fb_wake
10-05 22:09:33.795: ERROR/EventHub(93): could not get driver version
for /dev/input/mouse0, Not a typewriter
10-05 22:09:33.803: ERROR/EventHub(93): could not get driver version
for /dev/input/mice, Not a typewriter
10-05 22:09:41.014: ERROR/System(93): Failure starting core service
10-05 22:09:41.014: ERROR/System(93): java.lang.SecurityException
10-05 22:09:41.014: ERROR/System(93):     at
android.os.BinderProxy.transact(Native Method)
10-05 22:09:41.014: ERROR/System(93):     at
android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
146)
10-05 22:09:41.014: ERROR/System(93):     at
android.os.ServiceManager.addService(ServiceManager.java:72)
10-05 22:09:41.014: ERROR/System(93):     at
com.android.server.ServerThread.run(SystemServer.java:176)
10-05 22:09:41.404: ERROR/AndroidRuntime(93): Crash logging skipped,
no checkin service
10-05 22:12:35.684: ERROR/installd(31): eof
10-05 22:12:35.684: ERROR/installd(31): failed to read size

-- 

2. Mobile Identification Number API

Hi,

Right now we are able to retrieve the mobile number using
telephonyManager getLine1Number() where it also says that we could
retrieve MSISDN for a GSM phone as well.

The server that provides the content we display in our app is
requesting the MIN and not the MDN(Mobile Directory Number) because it
looks like these two number could change because: Prior to Wireless
Number Portability, MDN was the same number as the MIN for many mobile
phones. But now that MDN numbers can be ported (moved) to other
carriers, MDN and MIN will be different for ported numbers.

Is there an API available in Android SDK that could fit with this
requirements? I need to be able to retrieve the MIN and not MDN
(eventhough this could be the same in some devices).

Thanks for your help.

-- 

3. JNI interface permission

4. Routing audio input to bluetooth headset

5. Android Maps API + KML file

6. VerifyError reloaded

7. The Market App has a CACHE !