[android-developers] Re: How to change default HIPRI connection expiry?

2012-06-12 Thread Fievt Zerg
Hello, 

If you insist on modifying the expiry timeout, try to 
setPropertyhttp://developer.android.com/reference/java/lang/System.html#setProperty(java.lang.String,
 
java.lang.String)(android.telephony.apn-restore, *timeout* *ms*). It 
will override the default recovery time.

Meanwhile, solution provided by Sascha works well for your connection to be 
a workaround.

BRs,
Zerg

On Friday, June 1, 2012 4:30:40 PM UTC+8, Sascha wrote:

 Hello,

 I think there is no way to change the expiry timeout itself.

 However, you can reset the expiry event by calling

 connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
 enableHIPRI);

 repeatedly every 30 seconds or so.

 This should stabilize your connection as long as you need it.

 Hope this helps
 Sascha


 Am Donnerstag, 1. März 2012 02:55:50 UTC+1 schrieb flumby:

 In my project, I need to access an IP Address through mobile connection 
 --irrespective of whether it is connected to mobile or WIFI network. My 
 code is similar to below:


connMan = (ConnectivityManager) 
 getSystemService(Context.CONNECTIVITY_SERVICE);
int res = 
 connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
 enableHIPRI);

 Then when I get the notification that HIPRI is available, I call:
boolean reqRes = 
 connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI, 
 ipAddress);

 This is working fine. My app can connect to the URL specified in the 
 ipAddress. My app can send requests, and receive responses. However, the 
 connection gets disconnected after about a minute. Is there a way to have 
 HIPRI connection for longer time?

 To make a short story long,  I see the following in the log:
 D/ConnectivityService( 1640): ignoring as dup is found 
 stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire - 
 created 60026 mSec ago)

 I took a look at the source and I see that in ConnectivityService.java, 
 in the implementation of requestRouteToHost method, it calls:

   mHandler.sendMessageDelayed (mHandler.obtainMessage 
 (NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f), 
 getRestoreDefaultNetworkDelay());

 And I see that getRestoreDefaultNetworkDelay is returning 6. So, I 
 know why my app is getting disconnected after about a minute.
 My question is, how can I have HIPRI connection for a longer period -at 
 least 30 minutes?



-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to change default HIPRI connection expiry?

2012-06-04 Thread Sascha
Hello,

I think there is no way to change the expiry timeout itself.

However, you can reset the expiry event by calling

connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
enableHIPRI);

repeatedly every 30 seconds or so.

This should stabilize your connection as long as you need it.

Hope this helps
Sascha


Am Donnerstag, 1. März 2012 02:55:50 UTC+1 schrieb flumby:

 In my project, I need to access an IP Address through mobile connection 
 --irrespective of whether it is connected to mobile or WIFI network. My 
 code is similar to below:


connMan = (ConnectivityManager) 
 getSystemService(Context.CONNECTIVITY_SERVICE);
int res = 
 connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
 enableHIPRI);

 Then when I get the notification that HIPRI is available, I call:
boolean reqRes = 
 connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI, 
 ipAddress);

 This is working fine. My app can connect to the URL specified in the 
 ipAddress. My app can send requests, and receive responses. However, the 
 connection gets disconnected after about a minute. Is there a way to have 
 HIPRI connection for longer time?

 To make a short story long,  I see the following in the log:
 D/ConnectivityService( 1640): ignoring as dup is found 
 stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire - 
 created 60026 mSec ago)

 I took a look at the source and I see that in ConnectivityService.java, in 
 the implementation of requestRouteToHost method, it calls:

   mHandler.sendMessageDelayed (mHandler.obtainMessage 
 (NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f), 
 getRestoreDefaultNetworkDelay());

 And I see that getRestoreDefaultNetworkDelay is returning 6. So, I 
 know why my app is getting disconnected after about a minute.
 My question is, how can I have HIPRI connection for a longer period -at 
 least 30 minutes?


-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to change default HIPRI connection expiry?

2012-06-04 Thread Sascha
There is no way to change the expiry delay.

However, you can reset the timeout by calling 

connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
enableHIPRI);

every 30 seconds or so.

The connection should then be stable as long as you need it.

Hope this helps
Sascha

Am Donnerstag, 1. März 2012 02:55:50 UTC+1 schrieb flumby:

 In my project, I need to access an IP Address through mobile connection 
 --irrespective of whether it is connected to mobile or WIFI network. My 
 code is similar to below:


connMan = (ConnectivityManager) 
 getSystemService(Context.CONNECTIVITY_SERVICE);
int res = 
 connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
 enableHIPRI);

 Then when I get the notification that HIPRI is available, I call:
boolean reqRes = 
 connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI, 
 ipAddress);

 This is working fine. My app can connect to the URL specified in the 
 ipAddress. My app can send requests, and receive responses. However, the 
 connection gets disconnected after about a minute. Is there a way to have 
 HIPRI connection for longer time?

 To make a short story long,  I see the following in the log:
 D/ConnectivityService( 1640): ignoring as dup is found 
 stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire - 
 created 60026 mSec ago)

 I took a look at the source and I see that in ConnectivityService.java, in 
 the implementation of requestRouteToHost method, it calls:

   mHandler.sendMessageDelayed (mHandler.obtainMessage 
 (NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f), 
 getRestoreDefaultNetworkDelay());

 And I see that getRestoreDefaultNetworkDelay is returning 6. So, I 
 know why my app is getting disconnected after about a minute.
 My question is, how can I have HIPRI connection for a longer period -at 
 least 30 minutes?


-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: How to change default HIPRI connection expiry?

2012-05-02 Thread Jason Teagle
I've come into this thread late, but from reading the code you present and 
the docs, combined with my suspicious mind, it's leading me to think this:


You ask for the system to use HIPRI over TYPE_MOBILE, which it says it 
grants. But I can't see anything in the docs that suggests that this takes 
priority over *all* other types of network routes. It suggests that *if* the 
system were to use TYPE_MOBILE for comms, *then* it would use HIPRI - but if 
it decides to use TYPE_WIFI instead, then your calls are having no effect.


An analogy would be changing current directories on Windows from the command 
prompt. If you open the prompt, you are most likely going to be at 
C:\Users\MyLogin (on Windows 7) or something like that.


If you type cd D:\SomeSubDir it accepts it. But if you then type dir, you 
get the files from your own users directory - not the D directory.


If you now type d:, and then dir, *now* you get the files on the D 
subdirectory you changed to.


In other words, despite asking for a route to SomeSubDir over the D 
'network', we were still on the 'C' network effectively.


My point (there was always hope I was getting to one) is that as far as the 
device is concerned, you've created a route over TYPE_MOBILE / HIPRI, but 
TYPE_WIFI is still an option and it chooses to use it.


Is it possible that setNetworkPreference(TYPE_MOBILE) is the last piece of 
the puzzle?


(Inspired by this article: 
http://stackoverflow.com/questions/2513713/how-to-use-3g-connection-in-android-application-instead-of-wi-fi)



--
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: How to change default HIPRI connection expiry?

2012-05-02 Thread Robert Greenwalt
No - you should not setNetworkPreference.  That just ranks the different
default-routable networks so we prefer one over the other (like the current
default of using wifi over 3g if wifi is available).

You are correct that bringing up HIPRI doesn't make it take priority over
mobile data (or wifi).  However when you add the host route on the HIPRI
interface that does take priority for that particular address.

startUsingNetworkFeature followed by requestRouteToHost should do the
trick.  Right after the requestRouteToHost try getting a bugreport and look
at the route table.

It's possible that your particular android device doesn't do
requestRouteToHost correctly - it's not widely used.

I'm interested in this problem - if you want you can send me a tcpdump and
bugreport and I can take a look.

R

On Wed, May 2, 2012 at 5:39 AM, Jason Teagle teagle.ja...@gmail.com wrote:

 I've come into this thread late, but from reading the code you present and
 the docs, combined with my suspicious mind, it's leading me to think this:

 You ask for the system to use HIPRI over TYPE_MOBILE, which it says it
 grants. But I can't see anything in the docs that suggests that this takes
 priority over *all* other types of network routes. It suggests that *if*
 the system were to use TYPE_MOBILE for comms, *then* it would use HIPRI -
 but if it decides to use TYPE_WIFI instead, then your calls are having no
 effect.

 An analogy would be changing current directories on Windows from the
 command prompt. If you open the prompt, you are most likely going to be at
 C:\Users\MyLogin (on Windows 7) or something like that.

 If you type cd D:\SomeSubDir it accepts it. But if you then type dir, you
 get the files from your own users directory - not the D directory.

 If you now type d:, and then dir, *now* you get the files on the D
 subdirectory you changed to.

 In other words, despite asking for a route to SomeSubDir over the D
 'network', we were still on the 'C' network effectively.

 My point (there was always hope I was getting to one) is that as far as
 the device is concerned, you've created a route over TYPE_MOBILE / HIPRI,
 but TYPE_WIFI is still an option and it chooses to use it.

 Is it possible that setNetworkPreference(TYPE_**MOBILE) is the last piece
 of the puzzle?

 (Inspired by this article: http://stackoverflow.com/**
 questions/2513713/how-to-use-**3g-connection-in-android-**
 application-instead-of-wi-fihttp://stackoverflow.com/questions/2513713/how-to-use-3g-connection-in-android-application-instead-of-wi-fi
 )



 --
 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.comandroid-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en


-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: How to change default HIPRI connection expiry?

2012-04-30 Thread Robert Greenwalt
To route through hipri you will need to call requestRouteToHost, specifying
the hipri network type and the ip addr of the host you're trying to reach.

On Sun, Apr 29, 2012 at 6:42 AM, Med Chakib ouabimedcha...@gmail.comwrote:

 Hello,
 I have tried your method to use 3G and WIFI simultaneously, however data
 is still routed through WIFI even though HIPRI connection is successfully
 initiated and traffic to ipAddress is routed through it.

connMan = (ConnectivityManager) getSystemService(Context.**
 CONNECTIVITY_SERVICE);
int res = connMan.**startUsingNetworkFeature(**
 ConnectivityManager.TYPE_**MOBILE, enableHIPRI);
boolean reqRes = connMan.requestRouteToHost(**
 ConnectivityManager.TYPE_**MOBILE_HIPRI, ipAddress);

 Socket soc = new Socket(ipAddress,port);

 ...


 Any help through this problem ?

 --
 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+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to change default HIPRI connection expiry?

2012-04-29 Thread Med Chakib
Hello,
I have tried your method to use 3G and WIFI simultaneously, however data is 
still routed through WIFI even though HIPRI connection is successfully 
initiated and traffic to ipAddress is routed through it.

   connMan = (ConnectivityManager) 
 getSystemService(Context.CONNECTIVITY_SERVICE);
int res = 
 connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE, 
 enableHIPRI);
boolean reqRes = 
 connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI, 
 ipAddress); 

Socket soc = new Socket(ipAddress,port);

... 


Any help through this problem ? 

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] Re: How to change default HIPRI connection expiry?

2012-04-27 Thread Mohamed Chakib O.
Thank you! I will give it a try

Le 26 avril 2012 19:33, Robert Greenwalt rgreenw...@google.com a écrit :

 If you are making your own system image you can set the expiration timeout
 (or turn it off) through config.xml settings.  If you are not making a new
 system image you cannot adjust the expiration timeout.

 R


 On Wed, Apr 25, 2012 at 2:28 AM, Med Chakib ouabimedcha...@gmail.comwrote:

 Hello all,
 I'm currently working on a project that need a data connexion to be
 active while I'm connected on WIFI.
 Your solution seems to be exactly what I need. Did you find a way to
 extend the duration of your HIPRI connection ?
 Med

 On Mar 23, 10:01 pm, San sanees...@gmail.com wrote:
  Hey flumby,
 
  Did you get any solution? I am also facing the same issue...
 
  San
 
  On Mar 2, 11:08 pm, flumby jay.mojni...@gmail.com wrote:
 
 
 
 
 
 
 
   Has anyone played with TYPE_MOBILE_HIPRI? Is there a way to set the
   RestoreDefaultNetworkDelay or any other way to increase the duration
   ofHIPRIconnection?
 
   On Feb 29, 5:55 pm, flumby jay.mojni...@gmail.com wrote:
 
In my project, I need to access an IP Address through mobile
 connection
--irrespective of whether it is connected to mobile or WIFI
 network. My
code is similar to below:
 
   connMan = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
   int res =
connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
enableHIPRI);
 
Then when I get the notification thatHIPRIis available, I call:
   boolean reqRes =
connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI,
ipAddress);
 
This is working fine. My app can connect to the URL specified in the
ipAddress. My app can send requests, and receive responses.
 However, the
connection gets disconnected after about a minute. Is there a way
 to have
   HIPRIconnection for longer time?
 
To make a short story long,  I see the following in the log:
D/ConnectivityService( 1640): ignoring as dup is found
stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire
 -
created 60026 mSec ago)
 
I took a look at the source and I see that in
 ConnectivityService.java, in
the implementation of requestRouteToHost method, it calls:
 
  mHandler.sendMessageDelayed (mHandler.obtainMessage
(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f),
getRestoreDefaultNetworkDelay());
 
And I see that getRestoreDefaultNetworkDelay is returning 6.
 So, I know
why my app is getting disconnected after about a minute.
My question is, how can I haveHIPRIconnection for a longer period
 -at
least 30 minutes?

 --
 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+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 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+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to change default HIPRI connection expiry?

2012-04-26 Thread Med Chakib
Hello all,
I'm currently working on a project that need a data connexion to be
active while I'm connected on WIFI.
Your solution seems to be exactly what I need. Did you find a way to
extend the duration of your HIPRI connection ?
Med

On Mar 23, 10:01 pm, San sanees...@gmail.com wrote:
 Hey flumby,

 Did you get any solution? I am also facing the same issue...

 San

 On Mar 2, 11:08 pm, flumby jay.mojni...@gmail.com wrote:







  Has anyone played with TYPE_MOBILE_HIPRI? Is there a way to set the
  RestoreDefaultNetworkDelay or any other way to increase the duration
  ofHIPRIconnection?

  On Feb 29, 5:55 pm, flumby jay.mojni...@gmail.com wrote:

   In my project, I need to access an IP Address through mobile connection
   --irrespective of whether it is connected to mobile or WIFI network. My
   code is similar to below:

                  connMan = (ConnectivityManager)
   getSystemService(Context.CONNECTIVITY_SERVICE);
                  int res =
   connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
   enableHIPRI);

   Then when I get the notification thatHIPRIis available, I call:
                  boolean reqRes =
   connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI,
   ipAddress);

   This is working fine. My app can connect to the URL specified in the
   ipAddress. My app can send requests, and receive responses. However, the
   connection gets disconnected after about a minute. Is there a way to have
  HIPRIconnection for longer time?

   To make a short story long,  I see the following in the log:
   D/ConnectivityService( 1640): ignoring as dup is found
   stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire -
   created 60026 mSec ago)

   I took a look at the source and I see that in ConnectivityService.java, in
   the implementation of requestRouteToHost method, it calls:

         mHandler.sendMessageDelayed (mHandler.obtainMessage
   (NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f),
   getRestoreDefaultNetworkDelay());

   And I see that getRestoreDefaultNetworkDelay is returning 6. So, I 
   know
   why my app is getting disconnected after about a minute.
   My question is, how can I haveHIPRIconnection for a longer period -at
   least 30 minutes?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: How to change default HIPRI connection expiry?

2012-04-26 Thread Robert Greenwalt
If you are making your own system image you can set the expiration timeout
(or turn it off) through config.xml settings.  If you are not making a new
system image you cannot adjust the expiration timeout.

R

On Wed, Apr 25, 2012 at 2:28 AM, Med Chakib ouabimedcha...@gmail.comwrote:

 Hello all,
 I'm currently working on a project that need a data connexion to be
 active while I'm connected on WIFI.
 Your solution seems to be exactly what I need. Did you find a way to
 extend the duration of your HIPRI connection ?
 Med

 On Mar 23, 10:01 pm, San sanees...@gmail.com wrote:
  Hey flumby,
 
  Did you get any solution? I am also facing the same issue...
 
  San
 
  On Mar 2, 11:08 pm, flumby jay.mojni...@gmail.com wrote:
 
 
 
 
 
 
 
   Has anyone played with TYPE_MOBILE_HIPRI? Is there a way to set the
   RestoreDefaultNetworkDelay or any other way to increase the duration
   ofHIPRIconnection?
 
   On Feb 29, 5:55 pm, flumby jay.mojni...@gmail.com wrote:
 
In my project, I need to access an IP Address through mobile
 connection
--irrespective of whether it is connected to mobile or WIFI network.
 My
code is similar to below:
 
   connMan = (ConnectivityManager)
getSystemService(Context.CONNECTIVITY_SERVICE);
   int res =
connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
enableHIPRI);
 
Then when I get the notification thatHIPRIis available, I call:
   boolean reqRes =
connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI,
ipAddress);
 
This is working fine. My app can connect to the URL specified in the
ipAddress. My app can send requests, and receive responses. However,
 the
connection gets disconnected after about a minute. Is there a way to
 have
   HIPRIconnection for longer time?
 
To make a short story long,  I see the following in the log:
D/ConnectivityService( 1640): ignoring as dup is found
stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire -
created 60026 mSec ago)
 
I took a look at the source and I see that in
 ConnectivityService.java, in
the implementation of requestRouteToHost method, it calls:
 
  mHandler.sendMessageDelayed (mHandler.obtainMessage
(NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f),
getRestoreDefaultNetworkDelay());
 
And I see that getRestoreDefaultNetworkDelay is returning 6. So,
 I know
why my app is getting disconnected after about a minute.
My question is, how can I haveHIPRIconnection for a longer period -at
least 30 minutes?

 --
 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+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: How to change default HIPRI connection expiry?

2012-03-23 Thread San
Hey flumby,

Did you get any solution? I am also facing the same issue...

San

On Mar 2, 11:08 pm, flumby jay.mojni...@gmail.com wrote:
 Has anyone played with TYPE_MOBILE_HIPRI? Is there a way to set the
 RestoreDefaultNetworkDelay or any other way to increase the duration
 of HIPRI connection?

 On Feb 29, 5:55 pm, flumby jay.mojni...@gmail.com wrote:







  In my project, I need to access an IP Address through mobile connection
  --irrespective of whether it is connected to mobile or WIFI network. My
  code is similar to below:

                 connMan = (ConnectivityManager)
  getSystemService(Context.CONNECTIVITY_SERVICE);
                 int res =
  connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
  enableHIPRI);

  Then when I get the notification that HIPRI is available, I call:
                 boolean reqRes =
  connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI,
  ipAddress);

  This is working fine. My app can connect to the URL specified in the
  ipAddress. My app can send requests, and receive responses. However, the
  connection gets disconnected after about a minute. Is there a way to have
  HIPRI connection for longer time?

  To make a short story long,  I see the following in the log:
  D/ConnectivityService( 1640): ignoring as dup is found
  stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire -
  created 60026 mSec ago)

  I took a look at the source and I see that in ConnectivityService.java, in
  the implementation of requestRouteToHost method, it calls:

        mHandler.sendMessageDelayed (mHandler.obtainMessage
  (NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f),
  getRestoreDefaultNetworkDelay());

  And I see that getRestoreDefaultNetworkDelay is returning 6. So, I know
  why my app is getting disconnected after about a minute.
  My question is, how can I have HIPRI connection for a longer period -at
  least 30 minutes?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: How to change default HIPRI connection expiry?

2012-03-02 Thread flumby
Has anyone played with TYPE_MOBILE_HIPRI? Is there a way to set the
RestoreDefaultNetworkDelay or any other way to increase the duration
of HIPRI connection?

On Feb 29, 5:55 pm, flumby jay.mojni...@gmail.com wrote:
 In my project, I need to access an IP Address through mobile connection
 --irrespective of whether it is connected to mobile or WIFI network. My
 code is similar to below:

                connMan = (ConnectivityManager)
 getSystemService(Context.CONNECTIVITY_SERVICE);
                int res =
 connMan.startUsingNetworkFeature(ConnectivityManager.TYPE_MOBILE,
 enableHIPRI);

 Then when I get the notification that HIPRI is available, I call:
                boolean reqRes =
 connMan.requestRouteToHost(ConnectivityManager.TYPE_MOBILE_HIPRI,
 ipAddress);

 This is working fine. My app can connect to the URL specified in the
 ipAddress. My app can send requests, and receive responses. However, the
 connection gets disconnected after about a minute. Is there a way to have
 HIPRI connection for longer time?

 To make a short story long,  I see the following in the log:
 D/ConnectivityService( 1640): ignoring as dup is found
 stopUsingNetworkFeature for net 5: enableHIPRI by 9683/10033(expire -
 created 60026 mSec ago)

 I took a look at the source and I see that in ConnectivityService.java, in
 the implementation of requestRouteToHost method, it calls:

       mHandler.sendMessageDelayed (mHandler.obtainMessage
 (NetworkStateTracker.EVENT_RESTORE_DEFAULT_NETWORK, f),
 getRestoreDefaultNetworkDelay());

 And I see that getRestoreDefaultNetworkDelay is returning 6. So, I know
 why my app is getting disconnected after about a minute.
 My question is, how can I have HIPRI connection for a longer period -at
 least 30 minutes?

-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en