[android-developers] Re: Configuring global proxy from code
You cannot set a global proxy as you noticed that it is denied with
permission. Only apps that are signed with the same certificate of the
firmware can set the proxy(permission level 3).
One thing that you can do is to set a per connection based proxy. You
can set proxy separately for WIFI and APN also. Under advanced setting
in WIFI you set WIFI proxy and for APN you already know as you did in
emulator.
Hope this helps.
Thanks
Krishna
On Dec 28, 12:21 pm, Arka Sharma <arka.sharma1...@gmail.com> wrote:
> I have a requirement like as following
>
> if(condition){
> //configure the proxy so that all user traffic from browser goes
> through the configured proxy server
>
> }
>
> I am able to browse the web from the emulator after I configure the
> proxy from "settings -> wireless network -> Mobile network -> Access
> Point name -> Telkila -> proxy".I came to know that proxy
> configuration can also be done by inserting (99,'http_proxy',':') in /
> data/data/com.android.providers.settings/settings.db.system table.So I
> inserted the following row (99,'http_proxy','10.203.227.227:80') in
> the system table.But after inserting this I am still unable to browse
> the web through the emulator(this time i removed proxy settings from "
> Access Point name -> Telkila -> proxy").My strategy was like inserting
> this row from my code.I have tried this with Android 2.2,1.5 and 1.1
> with same result.I have also tried to use
> "Settings.System.putString(getContentResolver(),Settings.System.HTTP_PROXY,"<proxy_ip>:<proxy_port>)").I
> have also included "android.permission.WRITE_SETTINGS" in
> AndroidManifest.xml.This time in logcat I got a message like
> "htt_proxy moved to Secure.So I did
> Secure.putString(getContentResolver(), Secure.HTTP_PROXY,
> "10.203.227.227:80"); this time i included both
> "android.permission.WRITE_SECURE_SETTINGS" but it is throwing
> exception because of permission denial.
> All I want to do is set the global proxy not only for this application
> but also for every application from my code.Any help will be highly
> appreciated.
>
> Thanks & Regards,
> Arka
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home