Re: [android-developers] Android - ETHERNET TETHERING or something....

2016-12-14 Thread 'Robert Greenwalt' via Android Developers
It should be possible to do tethering through Ethernet, but it would depend
on the OEMs configuration of your device.

On Wed, Dec 14, 2016 at 5:29 AM, Helio Formaggio  wrote:

> ===English===
>
> Hello everyone.
> I'm having a little problem and it would be fixed if a condition worked on
> android.
>
> I need to keep two networks running on the device, managing probable
> connection drops, an ETHERNET and a WIFI.
>
> I have a limitation, my client has equipment with API 17.
>
> I managed to run the two networks, but the android system WIFI prevents a
> reconnection if it disconnect.
>
> How can I change this behavior programmatically?
>
> Is it possible to create tethering through ETHERNET? In this way it would
> work perfectly.
>
> Thank you...
>
>
> ===Portuguese===
>
> Olá a todos.
> Estou com um pequeno problema e ele seria solucionado se uma condição
> funcionasse no android.
>
> Preciso manter duas networks funcionado no dispositivo, gerrenciando
> prováveis quedas de conexão, uma ETHERNET e uma WIFI.
>
> Estou com uma limitação, meu cliente tem equipamentos com a API 17.
>
> Eu consegui funcionar as duas redes, mas o sistema do android
> impossibilita uma reconexão WIFI caso ela desconecte.
>
> Como eu posso mudar este comportamento programaticamente?
>
> Existe a possibilidade de criar um tethering atravéz da  ETHERNET ? Desta
> forma funcionaria perfeitamente.
>
> Obrigado...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/android-developers/ff6beab2-fa14-4358-865f-
> c63bec41df9a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01CmRFLqZPGQ0FO4-tuv%3DeGnXTUHt7v1rSKLkgHsYBTb%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Deny auto close for captive portal dialog on android devices

2016-07-07 Thread 'Robert Greenwalt' via Android Developers
+ Paul

On Wed, Jul 6, 2016 at 2:59 AM, Developer 
wrote:

> Hello,
>
> I'm the senior developer of an wifi project offering free internet access
> to citizen in some regions.
>
> Now on newer Android devices we are facing the problem that the captive
> portal dialogue gets closed as soon as the hotspot has unlocked full
> internet access for a wifi client.
> For legal reasons a client must accept some terms before he gets full
> internet access for a period of time (24h for example).
> But we also offer a free app so the user can get much longer access
> including roaming between different cities.
>
> Therefore we would like to forward the user automatically to the Play
> store if he optionally selects "install app" in our captive portal
> dialogue.
>
> But if we unlock the clients session first and trigger a forward
> afterwards, Android detects free wifi access and closes the captive portal
> dialogue immediately.
> The other way round, if we would just white list the Play store we could
> forward the client to our app entry but its now not possible to complete
> the login process because we cannot route him back.
>
> Does anybody knows a possible solution so that we will be able to login
> the client but also to trigger a forward on click to the Play store without
> getting auto closed as soon as android detects full internet access?
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/b4911104-5e55-4678-a5d3-5a5144cd49a4%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01DQbNPjV9rDsG-Gk7aTASWe%3DvCnxB9DxTdaq-AX_Oe0xQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] How do I get the ip of the device connected to me through wifi zone?

2016-06-07 Thread 'Robert Greenwalt' via Android Developers
I don't think this is supported.

On Tue, Jun 7, 2016 at 8:10 AM, Janibel Espinal 
wrote:

> Hello!
>
> I want to know, how can I get the ip of the devices that are connected to
> my cell phone, through wifi zone?
>
> if someone can help me, please.
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/617a9ac6-743e-4cec-89da-f8bd7a186b6e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01C6xxGx3pNR3uSrQMhdcPfZ1hyAD5fwC-5bMhWKmEhT%3DA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Hot spot connecting issue in Android 5.0 and above versions.

2016-05-24 Thread 'Robert Greenwalt' via Android Developers
The hotspot was not intended to be started/stopped via 3rd party apps.
This glitch has been fixed.  Please let us know if you can overcome this.

Regards
Robert

On Mon, May 23, 2016 at 11:00 PM, Harish Yerra 
wrote:

> Hi Droids,
>
> I have tried some piece of code to start wifi and hotspot pragmatically.
> It is working fine till Android 4.4 version but it is not working in
> Android 5.0 and above versions.
> I have seen in the change docs but i have not found any changes in the 5.0
> version regarding wifi and hotspot.
> Please let me know how can i overcome this.
>
> Ref : https://github.com/nickrussler/Android-Wifi-Hotspot-Manager-Class
> 
>
>
> Regards
> Harish
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/4fab905a-28bc-4bd7-bb00-96cdf8be748f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01CHSPHb7EMUvBHZqVn%2BOBT5eFvxXO82z5MvwR4wy1XrtQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] urgent help needed: getLinkDownstreamBandwidthKbps returning the value 102400 whereas the downstream Bandwidth is 10 MHz

2016-03-28 Thread 'Robert Greenwalt' via Android Developers
The function is documented as:
Retrieves the downstream bandwidth for this network in Kbps. This always
only refers to the estimated first hop transport bandwidth.

It is returning a guess based solely on the Radio Access Technology and is
tuned for the radio in the device.  It does not take into account the
network your attached to or any variability based on cell congestion or
signal quality issues.  This make information is somewhat inaccurate and is
mostly there as a guide so app developers don't need to know the relative
value of many RAT technologies when thinking about bandwidth.
If you had been on 1xRTT you would have gotten a much lower number.  LTE
could have offered the higher number but you were on slow LTE apparently.
This is WAI.

R


On Mon, Mar 28, 2016 at 11:08 AM, Abhishek Jain  wrote:

> Hi,
>
> The android API, getLinkDownstreamBandwidthKbps returns the value 102400
> (100 MHz). When I verified the same with *#0011# command on the Samsung
> Active S5, it shows 10MHz. Please let me know if I am missing something.
>
> Below is my code snippet to retreive getLinkDownstreamBandwidthKbps.
>
> int netBw;
> ConnectivityManager conMgr = (ConnectivityManager) 
> getSystemService(Context.CONNECTIVITY_SERVICE);
> Network[] networks = conMgr.getAllNetworks();
> NetworkInfo networkInfo;
> for (Network mNetwork : networks){
> networkInfo = conMgr.getNetworkInfo(mNetwork);
>
> if ((networkInfo.getType() == ConnectivityManager.TYPE_MOBILE) && 
> (networkInfo.getState().equals(NetworkInfo.State.CONNECTED))) {
> NetworkCapabilities capabilities = 
> conMgr.getNetworkCapabilities(mNetwork);
> int bw = capabilities.getLinkDownstreamBandwidthKbps();
> showMessage(networkInfo.getSubtypeName() +"downlink BW in kbps = " + 
> capabilities.getLinkDownstreamBandwidthKbps());
> showMessage(networkInfo.getSubtypeName() +"Uplink BW in kbps = " + 
> capabilities.getLinkUpstreamBandwidthKbps());
> break;
> }
>
>
> if ((networkInfo.getType() == ConnectivityManager.TYPE_WIFI) && 
> (networkInfo.getState().equals(NetworkInfo.State.CONNECTED))) {
> //ConnectivityManager.setProcessDefaultNetwork(network);
> NetworkCapabilities capabilities = 
> conMgr.getNetworkCapabilities(mNetwork);
> int bw = capabilities.getLinkDownstreamBandwidthKbps();
> showMessage("wifi bandwidth = " + bw/1024);
> break;
> }
> }
>
>
> *showMessage() is my own function to print the arguments passed to it.
>
> Regards
> Abhishek
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/5de34511-0fa5-409e-848f-1b95ccc77303%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01DNxXjZYF0rsnxq0tY0X7Ddg%3DLoe4eRLLdC2eWtS3UAXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] toggle mobile network

2016-03-22 Thread 'Robert Greenwalt' via Android Developers
I believe the API for this is system-only.  This is not something apps
generally do.

On Tue, Mar 22, 2016 at 11:58 AM, Sagar Agrawal 
wrote:

> I am building a universal security app so I want to enable mobile from
> inside my activity is their a proper way to do so as user interaction will
> not be possible for manual activiation.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/234529a4-8ec7-4eb3-9bd2-a631b7e16c31%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01Dh9DAkA6oP%2BbUFtj12A9SdwJur5SDW9LK1B1D6Wzm9zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Re: Multicast and WiFi tethering

2016-03-11 Thread 'Robert Greenwalt' via Android Developers
When doing tethering the wifi chip is running significantly different code
(softap mode instead of client mode).  I suspect a bug there.  I created an
internal bug (27607920) to track it.

On Fri, Mar 11, 2016 at 3:02 AM, Viktor Kessler 
wrote:

> Hi,
>
> did you solve the Problem?
>
> I have the same chellange as you back in 2011 and don't undestand why the
> Tehtering Phone is not participating in multicast session.
>
> Thx,
>
> Viktor
>
> Am Dienstag, 19. Juli 2011 12:41:30 UTC+2 schrieb Erik Hellman:
>
>> Hi,
>>
>> I got an application that sends and receives UDP messages using a
>> MulticastSocket. It works fine between two phones when both are
>> connected to a normal WiFi AP (e.g., my WiFi at home). However, when
>> either device has WiFi tethering active and the other device is
>> connected to this network sending Multicast packages doesn't work
>> anymore. If I set-up a third device which has WiFi tethering enabled
>> and let the first two devices connect to this network it works as
>> expected between the two devices (however, the third device with
>> tethering active cannot receive or send Multicast packages).
>>
>> My conclusion is that a device that has WiFi tethering enabled cannot
>> send or receive Multicast packages. Is this an expected behavior or
>> should I consider it a bug?
>>
>> Thanks!
>>
>> // Erik
>
> --
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to android-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/android-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-developers/a30cb7d5-880c-48ab-a62d-d5d2f6360f06%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/CABrF01DvGUTSbG35z6X%3DGZuvW%2BOyGH2S-pzHYjuzq7zrDPKW2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Can a Broadcast Receiver receive a Mobile Data CONNECTIVITY_CHANGE notification while WiFi is enabled?

2015-12-28 Thread 'Robert Greenwalt' via Android Developers
CONNECTIVITY_CHANGE is not a broadcast about the setting.  You said:
>
>
> It all works except that when WiFi is enabled the BroadcastReceiver does
> not get a notification when the user turns on mobile data from Settings. If
> there is a way around this limitation i would appreciate hearing about it.


This broadcast is instead telling you when the device establishes and loses
a data connection.  See the docs
.
So if you're on wifi and turn cell data on or off, nothing will happen and
a CONNECTIVITY_CHANGE bcast shouldn't be received.

Maybe try something like this

to
watch for Settings changes?

R

On Sun, Dec 27, 2015 at 4:13 PM, Mick Dawdy  wrote:

> For the many threads, blogs, examples and tutorials on the topic of
> Broadcast Receivers and mobile data connectivity I have not seen this
> question asked or answered.
>
> I believe, based on experimenting with one of my Apps, that the answer to
> this question is a distinct NO, that while WiFi is enabled, a Broadcast
> Receiver listening for Mobile Data CONNECTIVITY_CHANGE does not receive a
> broadcast notification when that event occurs. If I am wrong and have
> missed something or if you can confirm this independently please let me
> know.
>
> My App is a home screen Widget with two classes, ActiveMobileData is the
> AppWidgetProvider and ConnectivityChangeReceiver is the BroadcastReceiver.
> There is no App just the home screen widget. It simply toggles a home
> screen icon between red and green to indicate the current mobile data
> state. It has worked perfectly for several months with about 100 users.
>
> I decided to add the BroadcastReceiver to pick up clicks from Settings.
> This code is also straight forward - it determines the current state of
> mobile data, and uses a global boolean variable set by AppWidgetProvider to
> determine if the home screen icon is red or green. Then it simply ensures
> that the icon color matches the mobile data state.
>
> It all works except that when WiFi is enabled the BroadcastReceiver does
> not get a notification when the user turns on mobile data from Settings. If
> there is a way around this limitation i would appreciate hearing about it.
>
> I do think that the code will not help to answer the question as my
> assertion is either true or false regardless and i hope that someone has
> knowledge of this, but here is the code for the widget and then for the
> receiver.  I left out some details to keep it somewhat brief.*
> iconEnabled* is the global boolean variable shared between
> the AppWidgetProvider and BroadcastReceiver classes ...
>
> *public class ActiveMobileData extends AppWidgetProvider {*
> *static boolean iconEnabled;*
> *@Override*
> *public void onReceive(Context context, Intent intent) {*
> *if (intent.getAction() != null)*
> *super.onReceive(context, intent);*
> *else {*
> *context.startService(new Intent(context, ToggleService.class));*
> *}*
> *}*
> *@Override*
> *public void onUpdate(Context context, AppWidgetManager appWidgetManager,
> int[]appWidgetIds) {*
> *context.startService(new Intent(context, ToggleService.class));*
> *}*
> *public static class ToggleService extends IntentService {*
> *public ToggleService() {*
> *super("ActiveMobileData$ToggleService");*
> *}*
> *@Override*
> *protected void onHandleIntent(Intent intent) {*
> *ComponentName cn = new ComponentName(this,
> ActiveMobileData.class);*
> *AppWidgetManager mgr = AppWidgetManager.getInstance(this);*
> *mgr.updateAppWidget(cn, buildUpdate(this));*
> *}*
> *private RemoteViews buildUpdate(Context context) {*
> *RemoteViews updateViews = new
> RemoteViews(context.getPackageName(), R.layout.widget);*
> *if (!isMobileDataEnabled(getApplicationContext())) {*
> *updateViews.setImageViewResource(R.id.mobileDataState,
> R.mipmap.ic_launcher_g);*
> *enableMobileData(getApplicationContext(), true);*
> *iconEnabled = true;*
> *} else {*
> *updateViews.setImageViewResource(R.id.mobileDataState,
> R.mipmap.ic_launcher_r);*
> *enableMobileData(getApplicationContext(), false);*
> *iconEnabled = false;*
> *}*
> *Intent i = new Intent(this, ActiveMobileData.class);*
> *PendingIntent pi = PendingIntent.getBroadcast(context, 0, i, 0);*
> *updateViews.setOnClickPendingIntent(R.id.mobileDataState, pi);*
> *return updateViews;*
> *}*
> *public boolean isMobileDataEnabled(Context context) {*
> *// ... the code here is the one that uses Java reflection*
> *}*
> *private void enableMobileData(Context context, boolean enabled) {*
> *// ... the code here is the one that uses Java reflection*
> *}*
>
> *  } 

Re: [android-developers] Get the DNS details when the Device is connected to Data connection.

2015-10-01 Thread 'Robert Greenwalt' via Android Developers
On M you can use
ConnectivityManager.getLinkProperties(ConnectivityManager.getActiveNetwork()).getDnsServers()

On Thu, Oct 1, 2015 at 3:16 AM, Gunjan Pathak 
wrote:

> Hey everyone ,
>
> I am new to android development dont know much in details i want to get
> the details of the DNS when my device is connected to DATA COnnection . I
> know it is possible when i am connected to WIFI connection but i want it
> during the DATA CONNECTION . Please do guide me .
>
> Thank you .
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Get the DNS details when the Device is connected to Data connection.

2015-10-01 Thread 'Robert Greenwalt' via Android Developers
It may - I didn't explore back in time to see when the APIs were
added/exposed.

On Thu, Oct 1, 2015 at 12:22 PM, Gustavo Oliveira <gus...@gmail.com> wrote:

> Doesn't that work on Lollipop as well?
>
>
> On Thu, Oct 1, 2015 at 2:28 PM, 'Robert Greenwalt' via Android Developers
> <android-developers@googlegroups.com> wrote:
>
>> On M you can use
>> ConnectivityManager.getLinkProperties(ConnectivityManager.getActiveNetwork()).getDnsServers()
>>
>> On Thu, Oct 1, 2015 at 3:16 AM, Gunjan Pathak <gunjanpathak1...@gmail.com
>> > wrote:
>>
>>> Hey everyone ,
>>>
>>> I am new to android development dont know much in details i want to get
>>> the details of the DNS when my device is connected to DATA COnnection . I
>>> know it is possible when i am connected to WIFI connection but i want it
>>> during the DATA CONNECTION . Please do guide me .
>>>
>>> Thank you .
>>>
>>> --
>>> 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 unsubscribe from this group and stop receiving emails from it, send
>>> an email to android-developers+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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 unsubscribe from this group and stop receiving emails from it, send an
>> email to android-developers+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] WebView and ConnectivityManager.requestNetwork

2014-12-12 Thread 'Robert Greenwalt' via Android Developers
I think the WebView API may need to be made multinetwork aware.


On Fri, Dec 12, 2014 at 12:15 PM, Krystian Lewandowski 
krystian@gmail.com wrote:

 Hi,
 I'm trying to update ConnectivityManager.requestRouteToHost implementation
 from deprecated one to ConnectivityManager.requestNetwork introduced in
 Lollipop. It supports Sockets, SocketFactories, URLConnections - this is
 fine. The only thing missing at the moment is WebView support.
 Application's requirement is to route WebView.loadUrl requests via specific
 interface, but I can't see how it could be done with the new API (I can't
 use setProcessDefaultNetwork).

 I looked at WebView API but couldn't find anything new that would support
 changed routing API. Is it supported, am I missing something?

 Thank you,
 Krystian

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] can I get DhcpInfo - for Ethernet? instead of WiFi?

2014-08-14 Thread 'Robert Greenwalt' via Android Developers
There will be API to access this in the next release.  I think even the
previous release from Google I/O may have had API in the
ConnectivityManager to access a LinkProperties object for each network (or
the current default network) which would contain this information.


On Thu, Aug 14, 2014 at 5:47 PM, Mihai Badea rumbur...@gmail.com wrote:

 I have the following code to determine all info about my local network on
 Wifi:

 WifiManager wifiMan = 
 (WifiManager)context.getSystemService(Context.WIFI_SERVICE);
 dhcpInfo = wifiMan.getDhcpInfo();
 networkAddress = ntoh(dhcpInfo.netmask  dhcpInfo.ipAddress);
 broadcastAddress = ntoh((dhcpInfo.netmask  dhcpInfo.ipAddress) | 
 (~dhcpInfo.netmask));
 netMask = ntoh(dhcpInfo.netmask);
 ipAddress = ntoh(dhcpInfo.ipAddress);

 However I could not find a way to get this DhcpInfo object for Ethernet.
 There is no such thing as EthernetManager

 How to get the above info - while Android connected via Ethernet (USB OTG
 + Ethernet adapter)?


  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Email routing via WIFI or cell

2014-04-23 Thread 'Robert Greenwalt rgreenw...@google.com' via Android Developers
Q1 - not today.  We're working on this.

Q2 - not easily.

Is this a common scenario for you?

Regards,
Robert


On Wed, Apr 23, 2014 at 11:02 AM, genedyne gened...@gmail.com wrote:

 Here is the scenario:

 A smart phone is used to interface to a piece of equipment via WIFI (i.e.
 the equipment provides limited access point capability, and the phone
 connects to this).
 An application on the phone wants to send an email.
 It appears that (at least DEFAULT) behavior on phones is to route email
 via WIFI if connected, and the cellular provider if not connected via WIFI.
 Since the WIFI link in this case does not provide internet connectivity,
 the email SHOULD be routed to the cellular provider.

 Q1: Is Android smart enough to figure out that the WIFI link is NOT to the
 internet, and route the email to the cellular provider? If so, is this
 basic to android, or is it a feature that may or may not exist depending on
 the version and/or brand? This is the preferred solution, and I've noted
 Windows can determine if a network has internet access or not (but might
 know by doing something dumb, like pinging microsoft servers, etc.)

 Q2: Assuming Android is not 'smart enough' or cannot determine the WIFI
 link is not internet capable, is there a way for the application attempting
 to send an email to SPECIFY the email is to be routed via the cellular
 provider? I'm guessing this is unlikely, as a poorly written (or
 intentionally badly-behaved) application could rack up $$$ using cell data
 transfer when a perfectly good WIFI link was available.

 Thanks.

  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Email routing via WIFI or cell

2014-04-23 Thread 'Robert Greenwalt rgreenw...@google.com' via Android Developers
How about trying wifi first?


On Wed, Apr 23, 2014 at 6:37 PM, genedyne gened...@gmail.com wrote:

 For that matter, as the IoT grows, I'd expect there will be plenty of
 other situations where the same issue will arise. I really doubt we're the
 only ones to be so 'creative' ;-)


 On Wednesday, April 23, 2014 2:28:14 PM UTC-4, Robert Greenwalt wrote:

 Q1 - not today.  We're working on this.

 Q2 - not easily.

 Is this a common scenario for you?

 Regards,
 Robert


 On Wed, Apr 23, 2014 at 11:02 AM, genedyne gene...@gmail.com wrote:

 Here is the scenario:

 A smart phone is used to interface to a piece of equipment via WIFI
 (i.e. the equipment provides limited access point capability, and the phone
 connects to this).
 An application on the phone wants to send an email.
 It appears that (at least DEFAULT) behavior on phones is to route email
 via WIFI if connected, and the cellular provider if not connected via WIFI.
 Since the WIFI link in this case does not provide internet connectivity,
 the email SHOULD be routed to the cellular provider.

 Q1: Is Android smart enough to figure out that the WIFI link is NOT to
 the internet, and route the email to the cellular provider? If so, is this
 basic to android, or is it a feature that may or may not exist depending on
 the version and/or brand? This is the preferred solution, and I've noted
 Windows can determine if a network has internet access or not (but might
 know by doing something dumb, like pinging microsoft servers, etc.)

 Q2: Assuming Android is not 'smart enough' or cannot determine the WIFI
 link is not internet capable, is there a way for the application attempting
 to send an email to SPECIFY the email is to be routed via the cellular
 provider? I'm guessing this is unlikely, as a poorly written (or
 intentionally badly-behaved) application could rack up $$$ using cell data
 transfer when a perfectly good WIFI link was available.

 Thanks.

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] HttpUrlConnection - Slow Post Multipart Content

2014-02-21 Thread Robert Greenwalt
Since you think it's not network based how about using
http://developer.android.com/tools/debugging/debugging-tracing.html and
sprinkling trace output through the code to find the bottleneck?


On Fri, Feb 21, 2014 at 5:23 AM, Marco Serioli mseri...@gmail.com wrote:

 Hi guys!

 I've already posted this question on Stack Overflow:
 http://stackoverflow.com/questions/21932685/httpurlconnection-slow-post-multipart-content

 But maybe here I can find more solution :)


 I'm trying to post a test File to a tomcat server using Android. I'm
 developing on Android 4.1.2, but I have verified same problem on 4.0.3.

 The problem is that the file upload requires a very long time (about 70
 seconds for a 4MB file), also in local network. The time is equiparable
 using a 3g connection. I've excluded that it could be a server problem:
 executing the same call with curl it takes 1 / 2 seconds.

 I'm using Spring Android RestClient 1.0.1.RELEASE and, given Android
 version and the fact that I'm not overriding default behaviour, it uses
 HttpUrlConnection instead of HttpClient to make http requests.

 I have also implemented my custom ClientHttpSessionFactory in order to
 manipulate some details of SSL connection and I have defined my own
 implementation of ClientHttpRequestInterceptor in order to modify
 authentication header.

 All works, also the posting of small file. But when I try to send big
 files the time increase.

 I have also set setBufferRequestBody(false) in order to avoid
 OutOfMemoryException on big files. But this property have no effects on
 time required.

 Looking in DDMS shell, on Network Statistics I've also found that the
 network throughput is never over 250kb in TX.

 There seems to be a bootleneck, but how to investigate it?

 I can post some code if it could be useful!

 Thank you for any suggestion!
 Marco

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Wifi Direct - Peer To Peer question

2014-01-06 Thread Robert Greenwalt
Generally in RF a transmitter at the same or near frequency will interfere
with the receiver.  The sharp filters needed to support near-frequency full
duplex are large (resonant cavity
filterhttp://www.hol4g.com/documents/bird/CavityFilters_-Duplexers_catalog.pdf).
 Most of the time you can fake it though, alternating sending and receiving
with short time slices.  Wifi, including wifi direct does just that.  You
can receive packets and send packets though strictly speaking not at the
same time.


On Thu, Jan 2, 2014 at 6:19 AM, dani maoz maoz.d...@gmail.com wrote:

 Hi
 Is It possible for one device to be transmitter and receiver at the same
 time?
 I would like to write an application using 
 wifip2phttp://developer.android.com/guide/topics/connectivity/wifip2p.html

 Thanks in advance


  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] how to optimize reliability of gcm messages on 2G network?

2013-12-12 Thread Robert Greenwalt
Applications using GCM should never need concern themselves with 2g vs 3g
vs wifi issues.  That is supposed to be one of the values of GCM.

Someone from the GCM team should comment on 2G reliability.


On Mon, Dec 9, 2013 at 8:57 PM, ranjit R ranjitr...@gmail.com wrote:

 I am using 2g network for Instant messaging .with payload less than 2kb..
  In 3g network success rate of receiving gcm messages is 10/10 with out
 queueing of messages in gcm messaged in GCM server.

 In 2G network  here Is the problem 5/10 messages are received instantly
 other 5 goes in to queue I n GCM server ..
 My question is
 As Google queue messages on gcm server When phone is idle.
 1 is there a callback to device when gcm message is queue in server.
  2 is there way to optimize gcm messages on 2g network
 3 when does gcm expire.
 4 or is there better way of handling gcm message for 2G

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Forcing app to use wi-fi, not 3G, for latency reasons

2013-10-21 Thread Robert Greenwalt
We will prefer wifi networks over 3g networks if the user has enabled wifi
and is within range of a known network.  You can check if we are connected
to wifi via

NetworkInfo activeInfo = ConnectivityManager.getActiveNetworkInfo();
Boolean wifi = (activeInfo != null  activeInfo.getType() ==
ConnectiivtyManager.TYPE_WIFI);

There is no nice way to force a udp transmission onto wifi.


On Mon, Oct 21, 2013 at 8:04 AM, RLScott fixthatpi...@yahoo.com wrote:

 My app uses a UDP network protocol involving very little data.  But the
 round-trip latency is important.  I have heard that 3G latency is more
 variable than wi-fi, especially after a long period of inactivity.  My app
 will use the network data after several hours of inactivity, and I want
 that very first access to have the shortest possible latency.  (It is
 querying a network time server).  I thought about sending out some nonsense
 UDP packets to some other host just to wake up the channel, since I am
 told that the 3G network switches to faster response only after a few
 hits.  But then I thought it might be simpler just to insist that wi-fi be
 available to provide this particular function.  So is there anything in the
 API that allows me to either query if wi-fi is available, or to force the
 network access to use only 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
 ---
 You received this message because you are subscribed to the Google Groups
 Android Developers group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Problem with getScanResults()

2013-10-08 Thread Robert Greenwalt
Looks reasonable.  Can you take a bugreport?


On Tue, Oct 8, 2013 at 12:14 PM, BearTi mlrti...@gmail.com wrote:

 Hi,

 I´ve a big problem with the getScanResults() function. I always get 0
 as result.

 Here is my Code (it´s a service):

 public void onCreate() {
 super.onCreate();

 wifiMgr = (WifiManager)getSystemService(Context.WIFI_SERVICE);
 sharedPreferences =
 PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
 intentScan = new IntentFilter();
 intentScan.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
 scanReceiver = new ScanReceiver();

 screenOnReceiver = new ScreenOnReceiver();
 registerReceiver(screenOnReceiver, new
 IntentFilter(Intent.ACTION_SCREEN_ON));

 screenOffReceiver = new ScreenOffReceiver();
 registerReceiver(screenOffReceiver, new
 IntentFilter(Intent.ACTION_SCREEN_OFF));
 }

 @Override
 public void onDestroy () {
   unregisterReceiver(screenOnReceiver);
   unregisterReceiver(screenOffReceiver);
 }

 @Override
 public void onStart(Intent intent, int startId) {
 wifiMgr = (WifiManager)getSystemService(Context.WIFI_SERVICE);

 registerReceiver(scanReceiver, intentScan);

 showToasts = sharedPreferences.getBoolean(checkbox_notification,
 true);
 autoSync = sharedPreferences.getBoolean(checkbox_autosync, true);
 if(wifiMgr.getConnectionInfo().getNetworkId() == -1) {
 if(wifiMgr.setWifiEnabled(true)) {

if(!wifiMgr.startScan()){
unregisterReceiver(scanReceiver);
}
 }
 }else{
 if(showToasts)
 Toast.makeText(this.getApplicationContext(),R.string.toast_nochange,
 Toast.LENGTH_SHORT).show();
 }
 }




 public class ScanReceiver extends BroadcastReceiver {
 @Override
 public void onReceive(Context context, Intent intent) {
 Log.d(wifi, ScanComplete - +intent.getAction());

 ListWifiConfiguration wifiListSupplicant =
 wifiMgr.getConfiguredNetworks();
 ListScanResult wifiListScan = wifiMgr.getScanResults();


 Log.d(wifi, LIST: +wifiListScan.size());

 } }



 Somebody an idea?

 Thanks

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Problem with getScanResults()

2013-10-08 Thread Robert Greenwalt
adb bugreport  mybug

and send me the resulting mybug file


On Tue, Oct 8, 2013 at 1:08 PM, BearTi mlrti...@gmail.com wrote:

 How? What do u need?



 Am Dienstag, 8. Oktober 2013 21:14:55 UTC+2 schrieb BearTi:

 Hi,

 I´ve a big problem with the getScanResults() function. I always get 0
 as result.

 Here is my Code (it´s a service):

 public void onCreate() {
 super.onCreate();

 wifiMgr = (WifiManager)getSystemService(**Context.WIFI_SERVICE);
 sharedPreferences = PreferenceManager.**
 getDefaultSharedPreferences(**this.getApplicationContext());
 intentScan = new IntentFilter();
 intentScan.addAction(**WifiManager.SCAN_RESULTS_**
 AVAILABLE_ACTION);
 scanReceiver = new ScanReceiver();

 screenOnReceiver = new ScreenOnReceiver();
 registerReceiver(**screenOnReceiver, new
 IntentFilter(Intent.ACTION_**SCREEN_ON));

 screenOffReceiver = new ScreenOffReceiver();
 registerReceiver(**screenOffReceiver, new
 IntentFilter(Intent.ACTION_**SCREEN_OFF));
 }

 @Override
 public void onDestroy () {
   unregisterReceiver(**screenOnReceiver);
   unregisterReceiver(**screenOffReceiver);
 }

 @Override
 public void onStart(Intent intent, int startId) {
 wifiMgr = (WifiManager)getSystemService(**Context.WIFI_SERVICE);

 registerReceiver(scanReceiver, intentScan);

 showToasts = sharedPreferences.getBoolean(**checkbox_notification,
 true);
 autoSync = sharedPreferences.getBoolean(**checkbox_autosync,
 true);
 if(wifiMgr.getConnectionInfo()**.getNetworkId() == -1) {
 if(wifiMgr.setWifiEnabled(**true)) {

if(!wifiMgr.startScan()){
unregisterReceiver(**scanReceiver);
}
 }
 }else{
 if(showToasts)
 Toast.makeText(this.**getApplicationContext(),R.**string.toast_nochange,
 Toast.LENGTH_SHORT).show();
 }
 }




 public class ScanReceiver extends BroadcastReceiver {
 @Override
 public void onReceive(Context context, Intent intent) {
 Log.d(wifi, ScanComplete - +intent.getAction());

 ListWifiConfiguration wifiListSupplicant =
 wifiMgr.getConfiguredNetworks(**);
 ListScanResult wifiListScan = wifiMgr.getScanResults();


 Log.d(wifi, LIST: +wifiListScan.size());

 } }



 Somebody an idea?

 Thanks

  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Xml file corrupted over sprint cellular network ?

2013-10-03 Thread Robert Greenwalt
https?

I don't know who is mangling the data or what they are keying off.
 Changing the type was a good idea, but apparently not enough.  Maybe rot13
on the on the contents?  Turn on http compression?  This is all silly stuff
you shouldn't have to do.

R


On Thu, Oct 3, 2013 at 3:04 AM, Gaurav Sharma gauravsharma...@gmail.comwrote:

 @Robert can you suggest me any other way so i can fix the issue? I have
 tried changing xml content type in tomcat 6.0 but it did not work.


 On Sun, Sep 29, 2013 at 11:36 PM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 We have contacts with many of the carriers and I had them ask Sprint
 about this.


 On Sat, Sep 28, 2013 at 3:34 AM, Gaurav Sharma gauravsharma...@gmail.com
  wrote:

 @robert: How do you such information? have you faced this situation
 before or have they contacted you ?


 On Sat, Sep 28, 2013 at 4:31 AM, Robert Greenwalt rgreenw...@google.com
  wrote:

 I understand Sprint is investigating and may contact you for more info.


 On Thu, Sep 26, 2013 at 2:01 AM, Gaurav Sharma 
 gauravsharma...@gmail.com wrote:

 I am having a very strange issue in my android app. I receive xml file
 from server and perform operation based on xml content.

 It is working on almost every network for eg. ATT, Verizon in USA,
 airtel, vodaphone and others in india.But it not working on sprint network
 USA.

 When i tried to find xml content i am getting some byte code or
 unicode not the plain xml file. I looked for more information i found 
 other
 also has faced this issue on sprint evdeo. people says turn off byte 
 mobile
 optimization herehttp://t8387.codeinpro.us/q/50810aaa4f1eba38a4efcbd1

 I am not able to turn off mobile byte optimization. If i switch to
 wifi network it receive file properly. Issue occur on sprint cellular
 network only.

 Any help or any pointer will be very much appreciated. Thanks in
 advance

 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/eihARGT8Pl8/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




 --
 Gaurav Sharma
 Bangalore

 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/eihARGT8Pl8/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




 --
 Gaurav Sharma
 Bangalore

 --
 You received this message because you are subscribed to the Google

Re: [android-developers] Xml file corrupted over sprint cellular network ?

2013-10-03 Thread Robert Greenwalt
I was suggesting you could use https - then they can't muck with your
content.

Rot13 was suggested as a cheap way to mask your content.

Http compression is also just a way to mask the content, but it's clear in
the headers that this is happening and they may automatically see your
content anyway - it's less obscured than rot13.

R


On Thu, Oct 3, 2013 at 10:37 AM, Steve Gabrilowitz steveg1...@gmail.comwrote:

 Any chance you can use FTP protocol instead of HTTP to see if this fixes
 the issue?
 On Oct 3, 2013 1:28 PM, Gaurav Sharma gauravsharma...@gmail.com wrote:

 @Robert

 I am using HTTP not HTTPS.

 If rot13 is happening then i should be receiving changed character like A
 -N but that is not the case i am receiving some unreadable letter like
 byte symble $3.

  I will try with http comperession. Thanks for your suggestion.


 On Thu, Oct 3, 2013 at 10:36 PM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 https?

 I don't know who is mangling the data or what they are keying off.
  Changing the type was a good idea, but apparently not enough.  Maybe rot13
 on the on the contents?  Turn on http compression?  This is all silly stuff
 you shouldn't have to do.

 R


 On Thu, Oct 3, 2013 at 3:04 AM, Gaurav Sharma gauravsharma...@gmail.com
  wrote:

 @Robert can you suggest me any other way so i can fix the issue? I have
 tried changing xml content type in tomcat 6.0 but it did not work.


 On Sun, Sep 29, 2013 at 11:36 PM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 We have contacts with many of the carriers and I had them ask Sprint
 about this.


 On Sat, Sep 28, 2013 at 3:34 AM, Gaurav Sharma 
 gauravsharma...@gmail.com wrote:

 @robert: How do you such information? have you faced this situation
 before or have they contacted you ?


 On Sat, Sep 28, 2013 at 4:31 AM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 I understand Sprint is investigating and may contact you for more
 info.


 On Thu, Sep 26, 2013 at 2:01 AM, Gaurav Sharma 
 gauravsharma...@gmail.com wrote:

 I am having a very strange issue in my android app. I receive xml
 file from server and perform operation based on xml content.

 It is working on almost every network for eg. ATT, Verizon in USA,
 airtel, vodaphone and others in india.But it not working on sprint 
 network
 USA.

 When i tried to find xml content i am getting some byte code or
 unicode not the plain xml file. I looked for more information i found 
 other
 also has faced this issue on sprint evdeo. people says turn off byte 
 mobile
 optimization herehttp://t8387.codeinpro.us/q/50810aaa4f1eba38a4efcbd1

 I am not able to turn off mobile byte optimization. If i switch to
 wifi network it receive file properly. Issue occur on sprint cellular
 network only.

 Any help or any pointer will be very much appreciated. Thanks in
 advance

 --
 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 unsubscribe from this group and stop receiving emails from it,
 send an email to android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 a topic in
 the Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/eihARGT8Pl8/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




 --
 Gaurav Sharma
 Bangalore

 --
 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 unsubscribe from this group and stop receiving emails from it,
 send an email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https

Re: [android-developers] Xml file corrupted over sprint cellular network ?

2013-09-29 Thread Robert Greenwalt
We have contacts with many of the carriers and I had them ask Sprint about
this.


On Sat, Sep 28, 2013 at 3:34 AM, Gaurav Sharma gauravsharma...@gmail.comwrote:

 @robert: How do you such information? have you faced this situation before
 or have they contacted you ?


 On Sat, Sep 28, 2013 at 4:31 AM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 I understand Sprint is investigating and may contact you for more info.


 On Thu, Sep 26, 2013 at 2:01 AM, Gaurav Sharma gauravsharma...@gmail.com
  wrote:

 I am having a very strange issue in my android app. I receive xml file
 from server and perform operation based on xml content.

 It is working on almost every network for eg. ATT, Verizon in USA,
 airtel, vodaphone and others in india.But it not working on sprint network
 USA.

 When i tried to find xml content i am getting some byte code or unicode
 not the plain xml file. I looked for more information i found other also
 has faced this issue on sprint evdeo. people says turn off byte mobile
 optimization here http://t8387.codeinpro.us/q/50810aaa4f1eba38a4efcbd1

 I am not able to turn off mobile byte optimization. If i switch to wifi
 network it receive file properly. Issue occur on sprint cellular network
 only.

 Any help or any pointer will be very much appreciated. Thanks in advance

 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 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 a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/eihARGT8Pl8/unsubscribe
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




 --
 Gaurav Sharma
 Bangalore

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Xml file corrupted over sprint cellular network ?

2013-09-27 Thread Robert Greenwalt
I understand Sprint is investigating and may contact you for more info.


On Thu, Sep 26, 2013 at 2:01 AM, Gaurav Sharma gauravsharma...@gmail.comwrote:

 I am having a very strange issue in my android app. I receive xml file
 from server and perform operation based on xml content.

 It is working on almost every network for eg. ATT, Verizon in USA,
 airtel, vodaphone and others in india.But it not working on sprint network
 USA.

 When i tried to find xml content i am getting some byte code or unicode
 not the plain xml file. I looked for more information i found other also
 has faced this issue on sprint evdeo. people says turn off byte mobile
 optimization here http://t8387.codeinpro.us/q/50810aaa4f1eba38a4efcbd1

 I am not able to turn off mobile byte optimization. If i switch to wifi
 network it receive file properly. Issue occur on sprint cellular network
 only.

 Any help or any pointer will be very much appreciated. Thanks in advance

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Re: Xml file corrupted over sprint cellular network ?

2013-09-26 Thread Robert Greenwalt
There have been cases in the past where a carrier has intercepted and
alterned content flowing over their network - most notably graphics getting
down-rezed or compressed.  I'd not heard of this happening on xml, but the
fact that changing networks fixes the problem suggests something like this
may be happening.

What protocol are you using to transfer the file?


On Thu, Sep 26, 2013 at 8:03 AM, Nobu Games dev.nobu.ga...@gmail.comwrote:

 Could you post an example of such a corrupted version of your XML files?
 Maybe as a hex dump?


 On Thursday, September 26, 2013 4:01:31 AM UTC-5, Gaurav Sharma wrote:

 I am having a very strange issue in my android app. I receive xml file
 from server and perform operation based on xml content.

 It is working on almost every network for eg. ATT, Verizon in USA,
 airtel, vodaphone and others in india.But it not working on sprint network
 USA.

 When i tried to find xml content i am getting some byte code or unicode
 not the plain xml file. I looked for more information i found other also
 has faced this issue on sprint evdeo. people says turn off byte mobile
 optimization here http://t8387.codeinpro.us/q/50810aaa4f1eba38a4efcbd1

 I am not able to turn off mobile byte optimization. If i switch to wifi
 network it receive file properly. Issue occur on sprint cellular network
 only.

 Any help or any pointer will be very much appreciated. Thanks in advance

  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] How to configure Client MAC address in Android WiFi HotSpot through Code.

2013-09-09 Thread Robert Greenwalt
Trying to do mac based authentication where you must set the mac address of
the clients means that only clients with easily modified mac addresses
would work and that would kind of defeat the authentication, wouldn't it?

MAC authentication is not really worth the effort:
http://superuser.com/questions/19383/why-is-mac-based-authentication-insecure


On Sun, Sep 8, 2013 at 9:18 PM, rakesh kumar dogra.rakes...@gmail.comwrote:

 Thanks Robert,

 But I want to apply the MAC address authentication on Hotspot, is it
 posssible in Android.?



 On Friday, September 6, 2013 9:31:17 PM UTC+5:30, Robert Greenwalt wrote:

 I don't think this is supported.  MAC address is not supposed to be
 easily/frequently changed.


 On Thu, Sep 5, 2013 at 11:51 PM, rakesh kumar dogra.r...@gmail.comwrote:

  Hi All,

 I have  to configured Client  MAC address with Android WiFi Hotspot
 through code.
 I am able to start the Hotspot through code but not able to configure
 the client MAC address with hotspot.

 Can anyone help me to make it possible without rooting the android
 devices.

 Regards ,
 Rakesh

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+**unsubscr...@googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


  --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] How to configure Client MAC address in Android WiFi HotSpot through Code.

2013-09-06 Thread Robert Greenwalt
I don't think this is supported.  MAC address is not supposed to be
easily/frequently changed.


On Thu, Sep 5, 2013 at 11:51 PM, rakesh kumar dogra.rakes...@gmail.comwrote:

 Hi All,

 I have  to configured Client  MAC address with Android WiFi Hotspot
 through code.
 I am able to start the Hotspot through code but not able to configure the
 client MAC address with hotspot.

 Can anyone help me to make it possible without rooting the android devices.

 Regards ,
 Rakesh

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] can we check usb tethering and hotspot on/off in android?

2013-09-05 Thread Robert Greenwalt
No - this functionality is not currently exposed.


On Wed, Sep 4, 2013 at 9:29 PM, ansal ashish.a...@gmail.com wrote:

 Hi ,

 can we check usb-tethering and hotspot  on/off  in android?

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Manual Proxy Configuration not working on Android 2.3

2013-08-26 Thread Robert Greenwalt
This flavor of proxy support in Android didn't appear until Honeycomb
(3.1).  Prior to that there was the Proxy class in the framework that
reported a network-independent global proxy.


On Mon, Aug 26, 2013 at 7:16 AM, TG tirtha.g...@gmail.com wrote:

 I am using a Samsung Galaxy S Plus Phone running on Android 2.3.4

 I manually set the proxy server and the port in the phone, in Settings-
 Wireless  Network- Wi-Fi Settings- MENU Button- Advanced panel.

 My phone is still not able to communicate using the proxy. I tried the
 browser, and that is not able make use of the proxy settings.

 public static InputStream inputStreamForUrl(URL url) throws IOException {

 HttpURLConnection urlConnection = (HttpURLConnection) 
 url.openConnection(); // doesn't work on android 2.3.4
 urlConnection.setRequestMethod(GET);
 urlConnection.setDoInput(true);
 urlConnection.setConnectTimeout(3);
 urlConnection.setReadTimeout(3);
 System.out.println(urlConnection.usingProxy());
 urlConnection.connect();
 return urlConnection.getInputStream();}

 However, If I manually hardcode the proxy in the code, it works

 Proxy proxy = new Proxy(Proxy.Type.HTTP, new 
 InetSocketAddress(proxy.server.url, 8080));// this needs to be hard coded 
 to make it work in 2.3HttpURLConnection urlConnection = (HttpURLConnection) 
 url.openConnection(proxy);// this needs to be hard coded to make it work in 
 2.3

 I tried to dynamically find out the system proxy and then use it in code,

 private static void getProxySettings()
 {
 final boolean IS_ICS_OR_LATER = Build.VERSION.SDK_INT = 14;

 String proxyAddress = ;
 int proxyPort = 0;

 if( IS_ICS_OR_LATER )
 {
 proxyAddress = System.getProperty( http.proxyHost );

 String portStr = System.getProperty( http.proxyPort );
 proxyPort = Integer.parseInt( ( portStr != null ? portStr : -1 
 ) );
 }
 else
 {
 proxyAddress = android.net.Proxy.getHost( ctx );
 proxyPort = android.net.Proxy.getPort( ctx );
 }



 System.out.println(proxyAddress);
 System.out.println(proxyPort);
 }

 but the proxy address and port is null always.

 Can someone help please

 *PS.* I absolutely no problem on Android 4.1/4.2/4.3 devices

 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [android-developers] Check For Internet Connection

2013-07-16 Thread Robert Greenwalt
You certainly can have a race condition, but the more likely thing is
either the network never had internet reach (walled garden) or temporarily
doesn't have access to the internet.  Both the cell radio and wifi have a
tendency to hold on trying to get reconnected before they give up and
report a disconnection.

Other than that, your code looks good.

You can also cache this value and then listen for broadcasts rather than
calling ConnectivityManager all the time - depends on how often you check
this.


On Tue, Jul 16, 2013 at 9:58 AM, Nathan nathan.d.mel...@gmail.com wrote:

 The following is what I have seen as a fairly standard method for checking
 for an internet connection.

@Override
 public void checkforConnection(Context ctx) {
 // TODO Auto-generated method stub
 ConnectivityManager mgr = (ConnectivityManager)
 ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
 NetworkInfo ni = mgr.getActiveNetworkInfo();
 if(ni==null)
 this.noConnection.set(true);
 else if(!ni.isConnected())
 this.noConnection.set(true);
 else
 this.noConnection.set(false);

 }

 Is there any way this can fail?

 I have been using this for six months. Only two identifiable complaints.
 They may not be sophisticated enough to know if they have an internet
 connection, though. One has a friend that installs apps for him.

 Nathan

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] setting priority to wifi configured network so that has to connect to specified network in the region if available

2013-06-25 Thread Robert Greenwalt
Can you clarify your question?  Do you mean setting relative priority
between known wifi networks or do you mean relative priority between wifi
and cellular data?


On Tue, Jun 25, 2013 at 2:17 AM, Kondlada karthik.kondl...@gmail.comwrote:

 hi,
   Any one has succeed in setting wifi priority , please suggest me
 . Thanks

 regards,
 karthik kondlada

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] VPN connect/disconnect detection on Android 4+

2013-05-13 Thread Robert Greenwalt
I don't think there is a good solution currently.  This is definitely
broken and I hope it's fixed soon.


On Mon, May 13, 2013 at 10:23 AM, Martin Heller heller.m...@gmail.comwrote:

 Hi,

 has anyone any idea on this topic?

 I need this functionality for a SIP client to reregister with server
 when such network change occurs. Or, possibly, is there any workaround
 to avoid being effectively offline until the next regular reregistration?

 Thanks,

 Martin

 On 04/24/2013 10:03 AM, Martin Heller wrote:
  Hi,
 
  is there a way to detect VPN connection/disconnection on Android 4.0 and
  newer?
  I found
 
 http://stackoverflow.com/questions/6031821/no-connectivity-change-with-vpn
  and
 
 http://stackoverflow.com/questions/3461967/get-vpn-connection-status-on-android
  however this only works on Android older than 4.0.
 
  Thanks
 
  Martin

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Wifi POC - AP wifi connect using GPRS?

2013-05-02 Thread Robert Greenwalt
What is a POC?

What are you trying to use the cellular data for?  Do you want most traffic
to use wifi, but some traffic to use cellular?

R


On Tue, Apr 30, 2013 at 11:38 PM, Ran Cohen ranco...@gmail.com wrote:

 Dear All,

 i am working on a Wifi POC and have the next question:

 if i am to connect to a wifi AP using my cell (sony erricsson experia arc
 S android version 2.3.4* in that case*) can i still configure my cell to
 use GPRS?* if so:* can it be done via a program or only manualy? *if 
 not:*could i expect future devices to support this feature? (e.g. wifi direct)

 Thank you in advanced and BR,
 Ran

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] problem with VPN

2013-04-29 Thread Robert Greenwalt
While custom VPNs can do just that (split
tunnelinghttp://en.wikipedia.org/wiki/Split_tunneling),
the built in VPN solutions are not that configurable.  You can access the
internet through your vpn if your home network is set up for it though.

R


On Thu, Apr 25, 2013 at 3:06 AM, ramirez.moren...@gmail.com wrote:

 Hi.

 When i active the vpn (l2tp) in android 2.3.6 to connect to the office I
 do not have connection to Internet for the apn of my mobile company.

 Can i do one default route for internet and other route for the ip public
 for used the vpn?

 Than you for help me.
 Best regards
 JRM

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How to query IPV6 addresses from network interface like WiFi/3G

2013-04-23 Thread Robert Greenwalt
You're trying to find the local address for an interface?  It's not pretty
but how about parsing /proc/net/if_inet6?

Are you sure your IOCTL attempt was with a ipv6 address assigned?  I'd be
surprised if that were failing, but I entered an internal bug to track the
issue.

R


On Thu, Apr 18, 2013 at 11:11 PM, suresh tummala tsures...@gmail.comwrote:

 Hi,

   I have tried the following methods to obtain IPv6 address from
 interfaces like WiFi/3G for android.


- IOCTL query with AF_INET6 socket. But i got IPv4 address only
- getifaddrs API not supported in Android, not available in NDK
- Configuring static IPv6 address, but GUI not allowing IPv6 address to
 configure.
- Using route command from adb shell, but giving error Invalid
 arguments every time


Let me know is there any other menthod available to query IPv6 address
 in Android.

 Regards
 Suresh T.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-23 Thread Robert Greenwalt
It is possible the samsung radio is GCM aware.  That would be bad.  I've
added an internal bug to add a CTS test for this.


On Thu, Apr 18, 2013 at 8:21 PM, Long Pu long...@gmail.com wrote:

 It's galaxy S2.

 I believe the GCM works on this phone. I am wondering what GCM does to
 keep his socket alive.
 It would not seed keep alive packets in short period like several seconds,
 this would burn
 out battery very quickly.

 My guess is that the carrier can recognize the GCM tcp connection and only
 keep it alive.

 Cheers.
 Long


 On Fri, Apr 19, 2013 at 12:00 AM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 What phone hardware?


 On Thu, Apr 18, 2013 at 3:27 AM, Long Pu long...@gmail.com wrote:

 We only see this issue on Boost phones on WIMAX actually. Pure Sprint
 phones work fine.

 The minimal required period is a crazy value like 3~5 seconds.   Hope
 this info can help.
 Our guess is that maybe Boost rents other company's WIMAX network, so
 they would like to try their best to clean up idle connections.


 Thanks.

 Cheers.
 Long



 On Thu, Apr 18, 2013 at 1:03 AM, Robert Greenwalt rgreenw...@google.com
  wrote:

 Thanks Long Pu for the reasoning for not using GCM.

 You only have this problem on sprint wimax, correct?  Have to tried
 very frequent keep-alives?  Figuring out roughly what the required period
 is may help us find the cause.  We can talk with Sprint and Samsung about
 it, but the timeout info would be useful before that.

 R


 On Wed, Apr 17, 2013 at 7:28 AM, Long Pu long...@gmail.com wrote:

 We have to consider multiple platforms(iOS, Android, Blackberry). On
 iOS, push notification
 is not an option for our application.  If use GCM, we need  another
 extra special design especially for android.


 On Mon, Apr 15, 2013 at 11:23 PM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 Could you use GCMhttp://developer.android.com/google/gcm/index.html 
 instead
 of rolling your own long-lived connection with independent keepalive?
  It'll be better for the users battery and better for the carriers 
 network
 and you won't have to figure out issues like these.


 On Sat, Apr 13, 2013 at 3:35 AM, Long long...@gmail.com wrote:

 Hi Developers,
 I have an background service which connects my server with a TCP
 connection.
 My background service sends a ping packet to my server every
 4minutes to keep the socket alive.
The problem is that the device can not get the packet from the
 server after a short time(3 seconds from my test) after the ping is 
 sent.
This app works fine on other networks(ATT, verizon).

The strange thing is that if I force the device to connect to
 3G(EVDO revision A), it works fine.

It seems to me that, on Sprint 4G network, when an app sends a
 packet through a tcp socket, and then the socket is idle for
 several seconds, then the app will never be able to receive packets
 from this socket.

I don't think it's related to the 4G signal, since this issue can
 be reproduced every time.

Any suggestions?







 --
 --
 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 unsubscribe from this group and stop receiving emails from it,
 send an email to android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 a topic in
 the Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/3FvPZp5n2K0/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.






 --
 Things don' happen. Things are made to happen.

 --
 --
 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

Re: [android-developers] Re: Check the Status of VPN

2013-04-22 Thread Robert Greenwalt
I don't think there is an API for this.


On Tue, Apr 9, 2013 at 4:38 AM, Niels Kramer nielskram...@gmail.com wrote:

 Hello,,

 Did you ever solve this problem??

 I have the same problem atm. where i want to know if VPN Connection is
 closed and then launch my vpn firewall. Because it gets shutdown if i
 launch my VPN connection. ( I have not rooted my phone)

 Greetings,,

 Niels

 Op vrijdag 28 december 2012 07:48:43 UTC+1 schreef Priyanka het volgende:

 Hello All,

 Is there a  system wide capability to check the status of VPN on Android
 device ?

 Currently in my app the status of VPN connectivity is checked by hitting
 the url  getting response from the server if the site is available.
 However,
 it could be the case that the site is temporarily down but there is
 availability of VPN. So how do I get this status in application.

 Regards,
 Priyanka



  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-18 Thread Robert Greenwalt
What phone hardware?


On Thu, Apr 18, 2013 at 3:27 AM, Long Pu long...@gmail.com wrote:

 We only see this issue on Boost phones on WIMAX actually. Pure Sprint
 phones work fine.

 The minimal required period is a crazy value like 3~5 seconds.   Hope this
 info can help.
 Our guess is that maybe Boost rents other company's WIMAX network, so they
 would like to try their best to clean up idle connections.


 Thanks.

 Cheers.
 Long



 On Thu, Apr 18, 2013 at 1:03 AM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 Thanks Long Pu for the reasoning for not using GCM.

 You only have this problem on sprint wimax, correct?  Have to tried very
 frequent keep-alives?  Figuring out roughly what the required period is may
 help us find the cause.  We can talk with Sprint and Samsung about it, but
 the timeout info would be useful before that.

 R


 On Wed, Apr 17, 2013 at 7:28 AM, Long Pu long...@gmail.com wrote:

 We have to consider multiple platforms(iOS, Android, Blackberry). On
 iOS, push notification
 is not an option for our application.  If use GCM, we need  another
 extra special design especially for android.


 On Mon, Apr 15, 2013 at 11:23 PM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 Could you use GCM http://developer.android.com/google/gcm/index.html 
 instead
 of rolling your own long-lived connection with independent keepalive?
  It'll be better for the users battery and better for the carriers network
 and you won't have to figure out issues like these.


 On Sat, Apr 13, 2013 at 3:35 AM, Long long...@gmail.com wrote:

 Hi Developers,
 I have an background service which connects my server with a TCP
 connection.
 My background service sends a ping packet to my server every
 4minutes to keep the socket alive.
The problem is that the device can not get the packet from the
 server after a short time(3 seconds from my test) after the ping is sent.
This app works fine on other networks(ATT, verizon).

The strange thing is that if I force the device to connect to
 3G(EVDO revision A), it works fine.

It seems to me that, on Sprint 4G network, when an app sends a
 packet through a tcp socket, and then the socket is idle for
 several seconds, then the app will never be able to receive packets
 from this socket.

I don't think it's related to the 4G signal, since this issue can
 be reproduced every time.

Any suggestions?







 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/3FvPZp5n2K0/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.






 --
 Things don' happen. Things are made to happen.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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

Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-17 Thread Robert Greenwalt
Thanks Long Pu for the reasoning for not using GCM.

You only have this problem on sprint wimax, correct?  Have to tried very
frequent keep-alives?  Figuring out roughly what the required period is may
help us find the cause.  We can talk with Sprint and Samsung about it, but
the timeout info would be useful before that.

R


On Wed, Apr 17, 2013 at 7:28 AM, Long Pu long...@gmail.com wrote:

 We have to consider multiple platforms(iOS, Android, Blackberry). On iOS,
 push notification
 is not an option for our application.  If use GCM, we need  another extra
 special design especially for android.


 On Mon, Apr 15, 2013 at 11:23 PM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 Could you use GCM http://developer.android.com/google/gcm/index.html 
 instead
 of rolling your own long-lived connection with independent keepalive?
  It'll be better for the users battery and better for the carriers network
 and you won't have to figure out issues like these.


 On Sat, Apr 13, 2013 at 3:35 AM, Long long...@gmail.com wrote:

 Hi Developers,
 I have an background service which connects my server with a TCP
 connection.
 My background service sends a ping packet to my server every
 4minutes to keep the socket alive.
The problem is that the device can not get the packet from the server
 after a short time(3 seconds from my test) after the ping is sent.
This app works fine on other networks(ATT, verizon).

The strange thing is that if I force the device to connect to 3G(EVDO
 revision A), it works fine.

It seems to me that, on Sprint 4G network, when an app sends a packet
 through a tcp socket, and then the socket is idle for
 several seconds, then the app will never be able to receive packets from
 this socket.

I don't think it's related to the 4G signal, since this issue can be
 reproduced every time.

Any suggestions?







 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/3FvPZp5n2K0/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.






 --
 Things don' happen. Things are made to happen.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: Sprint 4G(WIMAX) tcp connection problem

2013-04-17 Thread Robert Greenwalt
I agree - testing 80 sounds like a good idea to gain more info about what
may be happening.


On Wed, Apr 17, 2013 at 10:43 AM, bob b...@coolfone.comze.com wrote:

 Is it an option to run the XMPP server on port 80?

 Or perhaps just set up a test server on port 80 to explore the hypothesis
 that this will resolve the problem?

 Alternatively, you could also create a proxy that runs on port 80 and acts
 as an intermediary.


 Thanks.



 On Wednesday, April 17, 2013 9:20:27 AM UTC-5, Long wrote:

 I am connecting to tcp port 5222 which provides xmpp service


 On Tue, Apr 16, 2013 at 12:00 AM, bob b...@coolfone.comze.com wrote:

 What port number are you using on the server?


 Maybe use *port* *80* as it is more open?


 Thanks.



 On Saturday, April 13, 2013 5:35:13 AM UTC-5, Long wrote:

 Hi Developers,
 I have an background service which connects my server with a TCP
 connection.
 My background service sends a ping packet to my server every
 4minutes to keep the socket alive.
The problem is that the device can not get the packet from the
 server after a short time(3 seconds from my test) after the ping is sent.
This app works fine on other networks(ATT, verizon).

The strange thing is that if I force the device to connect to
 3G(EVDO revision A), it works fine.

It seems to me that, on Sprint 4G network, when an app sends a
 packet through a tcp socket, and then the socket is idle for
 several seconds, then the app will never be able to receive packets
 from this socket.

I don't think it's related to the 4G signal, since this issue can be
 reproduced every time.

Any suggestions?







  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=enhttp://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit https://groups.google.com/d/**
 topic/android-developers/**3FvPZp5n2K0/unsubscribe?hl=enhttps://groups.google.com/d/topic/android-developers/3FvPZp5n2K0/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+**unsubscr...@googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .






 --
 Things don' happen. Things are made to happen.

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-15 Thread Robert Greenwalt
Could you use GCM http://developer.android.com/google/gcm/index.html instead
of rolling your own long-lived connection with independent keepalive?
 It'll be better for the users battery and better for the carriers network
and you won't have to figure out issues like these.


On Sat, Apr 13, 2013 at 3:35 AM, Long long...@gmail.com wrote:

 Hi Developers,
 I have an background service which connects my server with a TCP
 connection.
 My background service sends a ping packet to my server every 4minutes
 to keep the socket alive.
The problem is that the device can not get the packet from the server
 after a short time(3 seconds from my test) after the ping is sent.
This app works fine on other networks(ATT, verizon).

The strange thing is that if I force the device to connect to 3G(EVDO
 revision A), it works fine.

It seems to me that, on Sprint 4G network, when an app sends a packet
 through a tcp socket, and then the socket is idle for
 several seconds, then the app will never be able to receive packets from
 this socket.

I don't think it's related to the 4G signal, since this issue can be
 reproduced every time.

Any suggestions?







 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-15 Thread Robert Greenwalt
On Mon, Apr 15, 2013 at 8:44 AM, Kostya Vasilyev kmans...@gmail.com wrote:

 Robert,

 Could you elaborate on the issues like these part? Are there changes in
 Android that developers should be made aware?


By issues like these I just meant the inevitable bugs that will crop up
when making software.  If there is a library on the platform that already
does what you need it is risky to decide to create your own redundant code.


 I also have an app that uses long persistent server connection, and using
 GCM is not an option either.

 Can you elaborate on why GCM is not an option for you?  We want to make
GCM useful, so if it's missing features or is not an option we want to
know about it..


 It seems that with Android 4.1 and 4.2, connections often go dead --
 even though technically connected (at the server side), data pushed by the
 server stops getting through (this is verified by server logs).


Is that just on WiMAX as the original poster suggested?  Do you have
bugreports and/or packet captures?



 Android 4.0 does not seem to suffer from these issues, at least not to the
 same extent.

 A Nexus 7 and a Galaxy Nexus running the same stock 4.2.2, connected to
 the same server, over the same WiFi network, will experience dead
 connections at different rates (confirmed by logging).


Can you share a bugreport and packet capture?  There was no intention to
kill long-lived connections in android, so if there is an issue with 4.2.*
we need to hear about it.


 The suggestion to use GCM does not benefit everyone.


 It's nice that that Android has GTalk which provides GCM, and has its own
 keep-alive logic, but with it being closed source, and with apparent
 changes in recent Android versions, this leaves those developers who can't
 use GCM dead in the water.

 It would be great if someone from Google could comment, and explain,
 what's different in Android 4.1 - 4.2 with respect to long running
 connections, and what sort of magic is now required to keep them alive, for
 those apps that really need it.


As I said above we did not intentionally do anything to break long-lived
connections.  We encourage GCM use as it lets us do optimizations based on
mobile network type, etc to save on signaling traffic and battery life, but
you should still be able to roll your own if you wish.

There was a bug introduced in the 4.1 timeframe on mobile-data connections
we stopped counting udp packets when determining if a mobile connection was
hung - this could cause us to reset the mobile connection even when it was
live if only udp packets were being passed.  This doesn't apply to wifi OR
to mobile with GTalk alive - only on a private mobile network where GTalk
servers are inaccessible.


 Thanks,
 -- K


 2013/4/15 Robert Greenwalt rgreenw...@google.com

 Could you use GCM http://developer.android.com/google/gcm/index.html 
 instead
 of rolling your own long-lived connection with independent keepalive?
  It'll be better for the users battery and better for the carriers network
 and you won't have to figure out issues like these.


 On Sat, Apr 13, 2013 at 3:35 AM, Long long...@gmail.com wrote:

 Hi Developers,
 I have an background service which connects my server with a TCP
 connection.
 My background service sends a ping packet to my server every
 4minutes to keep the socket alive.
The problem is that the device can not get the packet from the server
 after a short time(3 seconds from my test) after the ping is sent.
This app works fine on other networks(ATT, verizon).

The strange thing is that if I force the device to connect to 3G(EVDO
 revision A), it works fine.

It seems to me that, on Sprint 4G network, when an app sends a packet
 through a tcp socket, and then the socket is idle for
 several seconds, then the app will never be able to receive packets from
 this socket.

I don't think it's related to the 4G signal, since this issue can be
 reproduced every time.

Any suggestions?







 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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

Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-15 Thread Robert Greenwalt
u


On Mon, Apr 15, 2013 at 10:46 AM, Kostya Vasilyev kmans...@gmail.comwrote:




 2013/4/15 Robert Greenwalt rgreenw...@google.com




 On Mon, Apr 15, 2013 at 8:44 AM, Kostya Vasilyev kmans...@gmail.comwrote:

 Robert,

 Could you elaborate on the issues like these part? Are there changes
 in Android that developers should be made aware?


 By issues like these I just meant the inevitable bugs that will crop up
 when making software.  If there is a library on the platform that already
 does what you need it is risky to decide to create your own redundant code.



 Yes, I understand the inevitable bugs, but GTalk / GCM work with those
 bugs, perhaps becuase they do things a certain way.

 I've seen GTalk's service menu, it seems it has separate keep-alive logic
 for mobile vs. WiFi Why? I can't tell just by reading the Android
 networking docs.


Most ipv4 is behind nats.  Even on the carrier side.  Each NATing agent
will have a timeout - no activity and they forget the connection state and
your connection is broken.  That timeout varies form network to network and
the timeout GTalk or GCM use have been tuned from android experience.  This
sort of tuning is another reason why relying on GCM is better than trying
to reinvent it.






 I also have an app that uses long persistent server connection, and
 using GCM is not an option either.

 Can you elaborate on why GCM is not an option for you?  We want to make
 GCM useful, so if it's missing features or is not an option we want to
 know about it..


 I have a little email app.

 Unless someone can convince Gmail, Yahoo, GMX, AOL, Dovecot, Courier, and
 all the rest switch to GCM, I'm kind of stuck with IMAP IDLE, which is a
 terrible protocol, but at least it's there.







 It seems that with Android 4.1 and 4.2, connections often go dead --
 even though technically connected (at the server side), data pushed by the
 server stops getting through (this is verified by server logs).


 Is that just on WiMAX as the original poster suggested?


 I don't have / use WiMax, the case I and one of my users investigated with
 logging was WiFi.


 Do you have bugreports and/or packet captures?


 I have seen server logs captured by a very helpful user, and ran my own
 app with logging, on two devices with 4.2.2, connected to the same WiFi
 access point, and same mail server.

 The symptoms are -- I can outline them in just a few sentences.

 My Android code is in a socket read (in a worker thread, of course), the
 device goes to sleep, the connection stays up.

 The server sends small packets of data from time to time.

 When the device has been asleep for a while (5-8-10 minutes, IIRC) and the
 server sends data:

 - The app no longer wakes up and receives the data
 - The next socket write from the server results in a socket write error
 (so the first packet was not acknowledged)

 In the tests I ran, the connection was alive at my home router (it has a
 UI where I can see the connections).

 If the device was not allowed to go to sleep, the issue did not occur.





 Android 4.0 does not seem to suffer from these issues, at least not to
 the same extent.

 A Nexus 7 and a Galaxy Nexus running the same stock 4.2.2, connected to
 the same server, over the same WiFi network, will experience dead
 connections at different rates (confirmed by logging).


 Can you share a bugreport and packet capture?  There was no intention to
 kill long-lived connections in android, so if there is an issue with 4.2.*
 we need to hear about it.


 Don't have a packet capture, but will try to submit a bug report, since
 there seems to be interest on your part. Thank you for this.

 Are there any changes to WiFi power saving in 4.1 - 4.2, perhaps it tries
 to go deeper than before into some sort of sleep state?

 Is it possible that this power saving mode has a low-level bug, where the
 WiFi radio stops responding to incoming packets?

 Would this be related to this old issue? I can only guess of course:
 https://code.google.com/p/android/issues/detail?id=9781




 The suggestion to use GCM does not benefit everyone.


 It's nice that that Android has GTalk which provides GCM, and has its
 own keep-alive logic, but with it being closed source, and with apparent
 changes in recent Android versions, this leaves those developers who can't
 use GCM dead in the water.

 It would be great if someone from Google could comment, and explain,
 what's different in Android 4.1 - 4.2 with respect to long running
 connections, and what sort of magic is now required to keep them alive, for
 those apps that really need it.


 As I said above we did not intentionally do anything to break long-lived
 connections.  We encourage GCM use as it lets us do optimizations based on
 mobile network type, etc to save on signaling traffic and battery life, but
 you should still be able to roll your own if you wish.


 How about documenting those optimizations, etc., or specifically, the
 special things GTalk

Re: [android-developers] Sprint 4G(WIMAX) tcp connection problem

2013-04-15 Thread Robert Greenwalt
I think he's suggesting that if app developers can't rely on wifi not
losing packets on this hardware with the AP it will see in the wild, we
should disable optimizations in general.

I think we found from our testing that the optimizations worked with a high
percentage of AP - all AP we tested against before shipping.


On Mon, Apr 15, 2013 at 12:02 PM, Irfan Sheriff isher...@gmail.com wrote:




 On Mon, Apr 15, 2013 at 11:50 AM, Kostya Vasilyev kmans...@gmail.comwrote:




 2013/4/15 Irfan Sheriff isher...@gmail.com




 On Mon, Apr 15, 2013 at 10:46 AM, Kostya Vasilyev kmans...@gmail.comwrote:



 I've seen GTalk's service menu, it seems it has separate keep-alive
 logic for mobile vs. WiFi Why? I can't tell just by reading the Android
 networking docs.


 I dont know what gtalk is doing, but a guess here is that wifi needs
 more aggressive keep alives due to NAT time outs being low on some access
 points.


 I could see the connections still alive in my router's UI.

 Not letting the device go to sleep would make the issue go away (with no
 change at the router or NAT or server).

 Let me ask you this -- when WiFi goes into power saving mode, is there a
 specific upper bound on the time it takes to wake back up (either triggered
 by an incoming packet, or an outgoing one)?





 Don't have a packet capture, but will try to submit a bug report, since
 there seems to be interest on your part. Thank you for this.

 Are there any changes to WiFi power saving in 4.1 - 4.2, perhaps it
 tries to go deeper than before into some sort of sleep state?

 Is it possible that this power saving mode has a low-level bug, where
 the WiFi radio stops responding to incoming packets?

 Would this be related to this old issue? I can only guess of course:
 https://code.google.com/p/android/issues/detail?id=9781


 This bug is a bit old.


 It's the closest I could find, sorry. I vaguely recall seeing some newer
 ones about the same thing.



 Can you clarify what  android device and access point you are using. You
 could send Robert or me an email with the details and the bugreport (a
 packet capture showing the problem may be even better)


 I do not have a packet capture, I had server and app logs, and given that
 there are no packet captures, I already explained the gist of it (saving
 you having to read the logs).

 My devices were (and are) a Galaxy Nexus and a Nexus 7 with 4.2.2 (or
 4.2.1?, I worked on this a lot in mid-December of last year). The user's
 devices included a Galaxy Nexus with 4.1.

 My home router, at the time, was a Zyxel Keentic Giga, with an 80 MBit/s
 PPTP connection.




 I ask because different wifi drivers do their own power optimizations
 and I have seen issues where these optimizations do not work well with
 certain access points. We have to chase these issues with the vendors.


 Ok, so the bug is a bit old, but the issue remains to this day?


 I can appreciate the complexity of tracking these down, and glad someone
 is doing it, but...

 it does not help when users have but the latest Android version with
 the latest drivers with fixes (I presume).




 There should not be generic issue like this on the platform itself - it
 is depended on the wifi driver.


 Looking at it from an application's point of view, it makes no difference
 if it's the driver or the framework or the kernel code.

 To the user it's even more simple: does not work.

 Should there be a system level setting to turn off those power
 optimizations, if they're known to not be compatible with all (taken as a
 metaphorical term) access point / router devices?


 There is. You could try turning off settings  wifi  advanced  wi-fi
 optimization
  to see if it makes a difference.

  The 
 HIGH_PERFhttp://developer.android.com/reference/android/net/wifi/WifiManager.html#WIFI_MODE_FULL_HIGH_PERFAPI
  also does the same and should be used with care due to power impact.


 -- K

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
-- 
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] How to disable the broadcasting of the SSID of the mobile hotspot (tethering)

2013-04-12 Thread Robert Greenwalt
I think that it could be a power savings - not having to broadcast the
beacon when available but unconnected for long periods..


On Thu, Apr 11, 2013 at 9:31 PM, Nick Kralevich n...@google.com wrote:


 Out of curiosity, why do you want this feature? The most common reason for
 not broadcasting the ssid is for security reasons. But not broadcasting
 the SSID actually makes the security situation worse, not better.


 http://www.howtogeek.com/howto/28653/debunking-myths-is-hiding-your-wireless-ssid-really-more-secure/

 -- Nick


 On Mon, Apr 8, 2013 at 4:30 AM, Frank mobile.app.wri...@gmail.com wrote:

 Hi all,

 Is it possible to disable the broadcasting of the SSID of the mobile
 hotspot (tethering)?
 I didn't see any device support this features. And i want to add this
 feature to hide the hotspot ssid. So other don't know a hotspot is being
 used.

 Thanks advanced.



 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






 --
 Nick Kralevich | Android Security | n...@google.com | 650.214.4037

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How to disable the broadcasting of the SSID of the mobile hotspot (tethering)

2013-04-08 Thread Robert Greenwalt
I don't think this is currently possible from the UI.  I'm not sure if the
drivers support this either.  Note that if you are using the hotspot (ie,
connected) sniffers can easily find the ssid.  Most people don't turn on
tethering and leave it unused for long periods as it will reduce battery
life.

R


On Mon, Apr 8, 2013 at 4:30 AM, Frank mobile.app.wri...@gmail.com wrote:

 Hi all,

 Is it possible to disable the broadcasting of the SSID of the mobile
 hotspot (tethering)?
 I didn't see any device support this features. And i want to add this
 feature to hide the hotspot ssid. So other don't know a hotspot is being
 used.

 Thanks advanced.



 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: How to disable the broadcasting of the SSID of the mobile hotspot (tethering)

2013-04-08 Thread Robert Greenwalt
I'll submit a feature request for this.


On Mon, Apr 8, 2013 at 11:23 AM, bob b...@coolfone.comze.com wrote:

 I seem to have this option on my phone:


 https://lh6.googleusercontent.com/-HiZRiqLG0rI/UWMK-ruIjCI/AWU/k6eN9qQs8Q4/s1600/lghotspot.jpg

 Thanks.




 On Monday, April 8, 2013 6:30:00 AM UTC-5, Frank wrote:

 Hi all,

 Is it possible to disable the broadcasting of the SSID of the mobile
 hotspot (tethering)?
 I didn't see any device support this features. And i want to add this
 feature to hide the hotspot ssid. So other don't know a hotspot is being
 used.

 Thanks advanced.



  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Loading Images Using HttpURLConnection Concurrently

2013-04-05 Thread Robert Greenwalt
Is it possible your carrier is silently downgrading images to save
bandwidth?  Perhaps try https?


On Fri, Apr 5, 2013 at 7:21 AM, Alex Fu alex.fu...@gmail.com wrote:

 Hello guys,

 I'm currently facing an issue that I think should be fairly simple. I have
 a GridView which will get populated with images. If the image can't be
 found on the local disk, it will attempt to download the image from the
 network. Images download successfully, however the problem I am having is
 that the first image downloads just fine, however the second image that is
 downloaded is in very poor quality and is a fraction of the size it should
 be (5KB vs 100KB). This only happens when using mobile data connection. On
 WiFi, images download perfectly. Here is a link to the exact method that is
 retrieving these images... https://gist.github.com/alexfu/5319597. Any
 ideas or suggestions are greatly appreciated!

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Loading Images Using HttpURLConnection Concurrently

2013-04-05 Thread Robert Greenwalt
I'm not suggesting it as a real fix, just as a test.  Using https they
won't be able to snoop and rescale the images if that's what's really
causing it.




On Fri, Apr 5, 2013 at 9:11 AM, Alex Fu alex.fu...@gmail.com wrote:

 Didn't think that would be a possibility. These images are less than 1 MB.
 Whats the reasoning behind using HTTPS? Just out of curiosity.
 On Apr 5, 2013 11:45 AM, Robert Greenwalt rgreenw...@google.com wrote:

 Is it possible your carrier is silently downgrading images to save
 bandwidth?  Perhaps try https?


 On Fri, Apr 5, 2013 at 7:21 AM, Alex Fu alex.fu...@gmail.com wrote:

 Hello guys,

 I'm currently facing an issue that I think should be fairly simple. I
 have a GridView which will get populated with images. If the image can't be
 found on the local disk, it will attempt to download the image from the
 network. Images download successfully, however the problem I am having is
 that the first image downloads just fine, however the second image that is
 downloaded is in very poor quality and is a fraction of the size it should
 be (5KB vs 100KB). This only happens when using mobile data connection. On
 WiFi, images download perfectly. Here is a link to the exact method that is
 retrieving these images... https://gist.github.com/alexfu/5319597. Any
 ideas or suggestions are greatly appreciated!

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send
 an email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 --
 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 a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/zf4czg611ZU/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/groups/opt_out.



  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How to get other/neighbouring GSM operator's name (at my location)

2013-03-21 Thread Robert Greenwalt
Those neighboring cells are all for your current carrier and it's optional
- many radios don't support it at all.

I don't think there's a public API to get the available networks.

R


On Thu, Mar 21, 2013 at 3:37 AM, Gaurav Wable gswa...@gmail.com wrote:

 Dear all,
  I tried to get the list of all GSM networks available at my
 location through following code -

 TelephonyManager telManager = (TelephonyManager)
 getSystemService(Context.TELEPHONY_SERVICE);
 telManager.listen(gsmListener,
 PhoneStateListener.LISTEN_SIGNAL_STRENGTHS);

 ListNeighboringCellInfo cellInfo =
 telManager.getNeighboringCellInfo();
 StringBuilder sb =new StringBuilder();
 for(NeighboringCellInfo nInfo : cellInfo) {
 sb.append(\ncid: + nInfo.getCid()+ lac: + nInfo.getLac()+
 n/w type: + nInfo.getNetworkType()+ psc: + nInfo.getPsc()+ rssi: +
 nInfo.getRssi()+\n);
 }
 String disp = Connected to:
 +telManager.getNetworkOperatorName()+||+telManager.getSimOperatorName()
 +\nrssi: +strength+ || +telManager.getLine1Number()+\n\nNeighbours
 +cellInfo.size()+sb.toString();


This gives me the cell id, LAC, network type, PSC, RSSI of
 neighbouring cell.

How can i get the network operator's name of neighbouring cell.

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] How to enable and disable mobile network programmatically ?

2013-03-01 Thread Robert Greenwalt
You could use ConnectivityManager.setMobileDataEnabled(false) - that will
just take down data (and mms).


On Fri, Mar 1, 2013 at 10:28 PM, mohammed Nuhail nuhail...@gmail.comwrote:

 Hello people,
 I want to enable and disable mobile network programmatically while
 pressing a button..please help me out with this..

 thanks in advance

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Catch network traffic?

2013-02-14 Thread Robert Greenwalt
well, tcpdump can record all traffic off a rooted device, but it won't tell
you which app sent it.  You could run just the app though.  Weeding out the
system traffic shouldn't be too difficult.


On Thu, Feb 14, 2013 at 2:36 AM, BearTi mlrti...@gmail.com wrote:

 I want to intercept the packeges/I want to see what data goes out of the
 mobilephone or what sites are called from a specific app.
 I don´t want to just count the traffic... thanks


 Am Donnerstag, 14. Februar 2013 01:27:57 UTC+1 schrieb Kristopher Micinski:

 Agreed: do you want to intercept and proxy it, or just account for it?

 Kris

 On Wed, Feb 13, 2013 at 4:33 AM, BearTi mlrt...@gmail.com wrote:
  Hi,
 
  is it possble to catch all network traffic respectively to get all the
  network traffic that comes from a specific app?
  (My phone is rootet)
 
  Thanks
 
  --
  --
  You received this message because you are subscribed to the Google
  Groups Android Developers group.
  To post to this group, send email to android-d...@**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=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 unsubscribe from this group and stop receiving emails from it, send
 an
  email to android-developers+**unsubscr...@googlegroups.com.
  For more options, visit 
  https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out.

 
 

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] reverse DNS lookup on Android

2013-02-14 Thread Robert Greenwalt
From java use InetAddress.getByName(8.8.8.8).getHostAddress().  You could
also do getByAddress, but then you have to get the address into a byte
array.

From native, getnameinfo


On Thu, Feb 14, 2013 at 7:58 AM, bob b...@coolfone.comze.com wrote:

 Does anyone know how to do a reverse DNS lookup on Android and get the
 host name from the IP address?


 For instance, I might want the hostname that corresponds to 192.168.0.202


  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: Catch network traffic?

2013-02-14 Thread Robert Greenwalt
I believe the source for the developer tool ships with AOSP in the external
directory.


On Thu, Feb 14, 2013 at 9:07 AM, BearTi mlrti...@gmail.com wrote:

 Allright, thanks! Hmm but where can I get tcpdump?
 It´s in the store right?

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Catch network traffic?

2013-02-13 Thread Robert Greenwalt
catch meaning prohibit, or meaning monitor/count?

Current versions of android do per-app data accounting - I believe the
data-usage page in settings shows the data.


On Wed, Feb 13, 2013 at 1:33 AM, BearTi mlrti...@gmail.com wrote:

 Hi,

 is it possble to catch all network traffic respectively to get all the
 network traffic that comes from a specific app?
 (My phone is rootet)

 Thanks

 --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: How i connect from android to another cellphone with (DUN or PAN)?

2013-02-12 Thread Robert Greenwalt
Despite some misnamed features, android does not actually support the DUN
connection style with AT commands, etc.  We do support a variety of BT
connection profiles though, including raw sockets for passing arbitrary
data and PAN/PNEP for tethering.


On Tue, Feb 12, 2013 at 8:14 AM, bob b...@coolfone.comze.com wrote:

 If your other cellphone is not Android, what is it?



 On Tuesday, February 12, 2013 7:45:05 AM UTC-6, Antonis Kanaris wrote:


I create a simple bluetooth terminal for android and i want to
 connect with other cellphone not android support uuid=1115(PAN) with
 personal area networkand share internet connection to android.How i do
 this?I know for (DUN) is AT+CGDCONT=1,IP,APN...and after dial with
 ATD*99***1# What is the procedure for PAN?I connected with my PC and
 BlueSoleil with cellphone share internet to pc...I test it again with DUN
 bluetooth service...

  AT+CGDCONT=1,IP,MYAPN
  REPLY OK

  ATD*99***1#
  REPLY CONNECT

 After what can i do?I can use url from my terminal?How i keep my
 application to backgroung and open my browser for use internet?

  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: unable to connect host server pc

2013-02-07 Thread Robert Greenwalt
As Bob said, the socket constructor just does InetAddress.getAllByName on
the destination name you provided.  If the name provided is a valid ip
string no dns lookup is performed and UnknownHostException shouldn't be
possible.

Could you perhaps have badly formated the string (used a comma instead of a
period) or used an out-of-range octet (255)?

R


On Thu, Feb 7, 2013 at 7:08 AM, bob b...@coolfone.comze.com wrote:

 This is the correct format:

 clientSocket = new Socket(192.168.0.100,PORT);

 I doubt you could get that exception if you were using that format.




 On Wednesday, February 6, 2013 9:54:04 PM UTC-6, Ananda Krishna wrote:

 hi Robert Greenwalt,
 *I have given the ip address of the my pc which is the server for
 testing the code.*
 *Regards,*
 *AnandaKrishna S*

 On Wednesday, February 6, 2013 7:22:16 PM UTC+5:30, Ananda Krishna wrote:

 Hi,
 I am running a server which sends data to the client i.e android device
 with the help of sockets via wifi .On client side i am getting the
 following exception.
 *Exception: java.net.unknownhostexception unable to resolve host .*

 *Code:*
 *
 *
 clientSocket = new Socket(MY_PC_IP(SERVER_IP),**PORT);
 BufferedReader br = new BufferedReader(new InputStreamReader(**
 clientSocket.getInputStream())**);
 clientSocket.close();

 *Note : Both PC and the wifi connected android device is in the same
 network with proxy disabled for both PC and device.*
 *Any Suggestion in this regard would be appreciated.*

 Regards,
 AnandaKrishna S


  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] unable to connect host server pc

2013-02-06 Thread Robert Greenwalt
You indicate a literal string MY_PC_IP(SERVER_IP) for the host name.  Is
that accurate, or do you mean you have an ip addr there?
 UnknownHostException means a failed dns lookup.  If you're using an ip
addr string, dns shouldn't be involved, but if you're using a host name it
probably means that host is not known to your dns server.  Are you running
your own dns server?

R


On Wed, Feb 6, 2013 at 5:52 AM, Ananda Krishna 
anandakrishna15.1...@gmail.com wrote:

 Hi,
 I am running a server which sends data to the client i.e android device
 with the help of sockets via wifi .On client side i am getting the
 following exception.
 *Exception: java.net.unknownhostexception unable to resolve host .*

 *Code:*
 *
 *
 clientSocket = new Socket(MY_PC_IP(SERVER_IP),PORT);
 BufferedReader br = new BufferedReader(new
 InputStreamReader(clientSocket.getInputStream()));
 clientSocket.close();

 *Note : Both PC and the wifi connected android device is in the same
 network with proxy disabled for both PC and device.*
 *Any Suggestion in this regard would be appreciated.*

 Regards,
 AnandaKrishna S


  --
 --
 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 unsubscribe from this group and stop receiving emails from it, send an
 email to android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Mobile network idle sockets disconnected

2013-01-29 Thread Robert Greenwalt
There aren't any network requirements I think.  This is purely device side
and connects using different parameters and doesn't apply default routes
(it's a secondary net supposedly used next to a default connection).  Can
you do a logcat -b radio on the note and see?

It looks like the only way to get that log (and nothing in between) is to
call stopUsingNetworkFeature.  However it needs to be called by the same
process/user.  That's according the code we ship - Samsung code can be
doing something different.  There weren't any log lines between those two?


On Tue, Jan 29, 2013 at 6:45 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Some more information... I tried using another SIM card, using a different
 APN, and it didn't work on any of the devices.
 What are the network requirements for this special network feature?



 On 29 January 2013 13:58, Goncalo Oliveira gonc...@minkan.net wrote:

 logcat on galaxy note drops this

 01-29 13:50:03.252: D/ConnectivityService(1865): startUsingNetworkFeature
 reconnecting to 0: enableMMS
 01-29 13:51:03.332: D/ConnectivityService(1865): stopUsingNetworkFeature:
 teardown net 0: enableMMS


 On 29 January 2013 13:43, Goncalo Oliveira gonc...@minkan.net wrote:

 Well, the MMS APN trick does work.. on some devices. On others it
 doesn't.
 Tested with 2 devices with Android 2.3.3 and 3.2 and worked.
 On Samsung Galaxy Note with Android 4.0.4 it's not working. I wonder if
 it's the feature string that is different or if it has something to do with
 Android version...

 Any hints?


 On 28 January 2013 17:15, Goncalo Oliveira gonc...@minkan.net wrote:

 Thanks Robert, I really appreciate your help. I'll try as you suggest.


 On 28 January 2013 16:59, Robert Greenwalt rgreenw...@google.comwrote:

 I don't think you're making your own builds, so you'll have to set the
 APN data on each device (though you probably already have to do this as
 it's not a public apn).  In the apn data set the type of the apn to mms
 instead of default or blank.  Remove any default/blank apn for your
 mcc/mnc pair.

 In your app, you will need to call
 CM.startUsingNetworkFeature(TYPE_MOBILE, enableMMS).  This will turn off
 every 10 minutes (by default - may be different on different phones) so 
 you
 need to call it repeatedly forever perhaps every 9.5 minutes.  Then you
 need to call requestRouteToHost(TYPE_MOBILE_MMS, int addr) for every IP
 addr you're accessing.  Then you should be able to access the servers
 normally.

 R


 On Mon, Jan 28, 2013 at 8:34 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Hi Robert, thanks for such a prompt answer.

 Firstly, it's 3 mb in 3 days, 1mb/day. The DNS resolves the addresses
 correctly, but the connections will fail. Unfortunately I don't have 
 access
 to DNS servers, so it's a bit harder to capture this traffic. I've
 installed Onavo count to capture the traffic, and I can see the usage
 growing up with Android OS.

 The APN idea seems to be a good workaround. Breaking the brower or
 other apps isn't really a problem for us, as this is something very
 specific. Can you tell me where can I find more information on how to do
 this?

 Cheers


 On 28 January 2013 16:14, Robert Greenwalt rgreenw...@google.comwrote:

 I am curious what the 3mb/day of data consists of if the servers
 can't be reached.  3mb of tcp connect attempts?  DNS lookups?  If it's 
 DNS
 perhaps you could populate your local DNS server with bogus records so 
 that
 the DNS requests die down to be replaced with perhaps fewer failing 
 connect
 attempts?  Can you capture this traffic?

 You could potentially use a different APN type.  Instead of using a
 default type you could put it on type IMS or type MMS.  This will 
 involve a
 bit more work for you, but if you don't a a default connection the other
 apps shouldn't use any data.  This would also mean things like the 
 browser
 won't work.



 On Mon, Jan 28, 2013 at 3:58 AM, Goncalo Oliveira 
 gonc...@minkan.net wrote:

 Sorry for reopening this, but I have a consequence behavior with
 this and was hoping for some insights.

 As I said earlier, we are using a very specific APN that allows the
 connection only to a restricted range of servers. I managed to use a
 heartbeat every 5 minutes to workaround the GCM issue, and with the app
 everything is working fine. However, I have another consequence. 
 Because
 the APN restricts access to anything outside our safe little world, 
 the
 system is consuming a whole load of data. Android OS consumed 3 mb in 
 three
 days, Google Services 416 k. In the data settings I was able to 
 restrict
 Google Services (as well as software updates and others) from using 
 data
 but I can't do the same for Android OS. This is killing us completely
 because we have a very restrictive data plans.

 Any ideas on how I can disable data transfer for everything except
 my application?

 Thanks


 On 21 December 2012 15:55, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Thanks again

Re: [android-developers] Mobile network idle sockets disconnected

2013-01-28 Thread Robert Greenwalt
I am curious what the 3mb/day of data consists of if the servers can't be
reached.  3mb of tcp connect attempts?  DNS lookups?  If it's DNS perhaps
you could populate your local DNS server with bogus records so that the DNS
requests die down to be replaced with perhaps fewer failing connect
attempts?  Can you capture this traffic?

You could potentially use a different APN type.  Instead of using a default
type you could put it on type IMS or type MMS.  This will involve a bit
more work for you, but if you don't a a default connection the other apps
shouldn't use any data.  This would also mean things like the browser won't
work.



On Mon, Jan 28, 2013 at 3:58 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Sorry for reopening this, but I have a consequence behavior with this and
 was hoping for some insights.

 As I said earlier, we are using a very specific APN that allows the
 connection only to a restricted range of servers. I managed to use a
 heartbeat every 5 minutes to workaround the GCM issue, and with the app
 everything is working fine. However, I have another consequence. Because
 the APN restricts access to anything outside our safe little world, the
 system is consuming a whole load of data. Android OS consumed 3 mb in three
 days, Google Services 416 k. In the data settings I was able to restrict
 Google Services (as well as software updates and others) from using data
 but I can't do the same for Android OS. This is killing us completely
 because we have a very restrictive data plans.

 Any ideas on how I can disable data transfer for everything except my
 application?

 Thanks


 On 21 December 2012 15:55, Goncalo Oliveira gonc...@minkan.net wrote:

 Robert,

 Thanks again for clarifying. Basically if I open up GCM I'm allowing user
 to work with gtalk, so I will want to avoid that.
 Looks like sending the heartbeat every 5 minutes is the only option I
 have left.

 Thanks for the help. Much appreciated.
 Cheers


 On 21 December 2012 15:44, Robert Greenwalt rgreenw...@google.comwrote:

 I believe most of the google apps rely on GCM (calendar, gmail,
 contacts, talk, etc), also 3rd party apps that need pushed notifications
 are encouraged to use GCM.  Unless you are making a custom build and
 denying app installs you probably have apps that will be broken without GCM.

 Of course, if you have very limited data plans on special purpose
 phones, you may wish for all those apps to be broken - they can use quite a
 bit of data.

 I don't know what GCM's steady-state data rate is for a device.  I
 believe it does a carrier keep-alive ping every 20-30 minutes.  It also
 checks for updates whenever the screen comes on.  Other than that I think
 it is dependent on user or network-originating app traffic.

 R


 On Fri, Dec 21, 2012 at 2:23 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Thank you for the explanation. There's just one more thing that I'd
 like you to help me understand. If we choose to allow the GCM connection,
 what kind of traffic can we expect to have? Like I said previously, we have
 a very tight data plan, so if the GCM connection adds more than just a few
 bytes, that might be a bad idea to enable it. Also, by enabling GCM
 connection, what am I allowing the users to do? Can they use gtalk or
 something else?

 Cheers


 On 21 December 2012 00:17, Robert Greenwalt rgreenw...@google.comwrote:


 The GCM is part of the platform - 3rd party apps depend on it and so
 there's no mechanism for deactivating it.

 If you can allow the GCM connection to succeed, you should avoid the
 current problems, but if you're going for a secure platform you may not
 want the GCM connection to succeed.

 You could potentially hijack the dns resolution: have your dns server
 report an address you control for mtalk.google.com, then allow
 connections to your own server, but no real functionallity.  With some
 reverse engineering you may be able to get to a quiet connection that
 doesn't trigger these data-stall triggers.

 The easiest solution is to adjust your keep-alive ping to  6 minutes.
  That will effect the battery, but less than allowing the resets to 
 happen.

 I have created internal issues to examine this issue, but even if we
 fixed it today internally you wouldn't see it for a long while.  The first
 issue is to find what traffic is causing this connection reset.  The 
 second
 is to re-eval counting udp packets (I am assuming that's causing part of
 this problem).

 I'm sorry you have hit this issue.

 Robert


 On Thu, Dec 20, 2012 at 4:30 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Robert,

 Any updates on this?

 Cheers


 On 18 December 2012 10:06, Goncalo Oliveira gonc...@minkan.netwrote:

 consider opening up the addre




 --
 Gonçalo Oliveira

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2013-01-28 Thread Robert Greenwalt
I don't think you're making your own builds, so you'll have to set the APN
data on each device (though you probably already have to do this as it's
not a public apn).  In the apn data set the type of the apn to mms
instead of default or blank.  Remove any default/blank apn for your
mcc/mnc pair.

In your app, you will need to call CM.startUsingNetworkFeature(TYPE_MOBILE,
enableMMS).  This will turn off every 10 minutes (by default - may be
different on different phones) so you need to call it repeatedly forever
perhaps every 9.5 minutes.  Then you need to call
requestRouteToHost(TYPE_MOBILE_MMS, int addr) for every IP addr you're
accessing.  Then you should be able to access the servers normally.

R


On Mon, Jan 28, 2013 at 8:34 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Hi Robert, thanks for such a prompt answer.

 Firstly, it's 3 mb in 3 days, 1mb/day. The DNS resolves the addresses
 correctly, but the connections will fail. Unfortunately I don't have access
 to DNS servers, so it's a bit harder to capture this traffic. I've
 installed Onavo count to capture the traffic, and I can see the usage
 growing up with Android OS.

 The APN idea seems to be a good workaround. Breaking the brower or other
 apps isn't really a problem for us, as this is something very specific. Can
 you tell me where can I find more information on how to do this?

 Cheers


 On 28 January 2013 16:14, Robert Greenwalt rgreenw...@google.com wrote:

 I am curious what the 3mb/day of data consists of if the servers can't be
 reached.  3mb of tcp connect attempts?  DNS lookups?  If it's DNS perhaps
 you could populate your local DNS server with bogus records so that the DNS
 requests die down to be replaced with perhaps fewer failing connect
 attempts?  Can you capture this traffic?

 You could potentially use a different APN type.  Instead of using a
 default type you could put it on type IMS or type MMS.  This will involve a
 bit more work for you, but if you don't a a default connection the other
 apps shouldn't use any data.  This would also mean things like the browser
 won't work.



 On Mon, Jan 28, 2013 at 3:58 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Sorry for reopening this, but I have a consequence behavior with this
 and was hoping for some insights.

 As I said earlier, we are using a very specific APN that allows the
 connection only to a restricted range of servers. I managed to use a
 heartbeat every 5 minutes to workaround the GCM issue, and with the app
 everything is working fine. However, I have another consequence. Because
 the APN restricts access to anything outside our safe little world, the
 system is consuming a whole load of data. Android OS consumed 3 mb in three
 days, Google Services 416 k. In the data settings I was able to restrict
 Google Services (as well as software updates and others) from using data
 but I can't do the same for Android OS. This is killing us completely
 because we have a very restrictive data plans.

 Any ideas on how I can disable data transfer for everything except my
 application?

 Thanks


 On 21 December 2012 15:55, Goncalo Oliveira gonc...@minkan.net wrote:

 Robert,

 Thanks again for clarifying. Basically if I open up GCM I'm allowing
 user to work with gtalk, so I will want to avoid that.
 Looks like sending the heartbeat every 5 minutes is the only option I
 have left.

 Thanks for the help. Much appreciated.
 Cheers


 On 21 December 2012 15:44, Robert Greenwalt rgreenw...@google.comwrote:

 I believe most of the google apps rely on GCM (calendar, gmail,
 contacts, talk, etc), also 3rd party apps that need pushed notifications
 are encouraged to use GCM.  Unless you are making a custom build and
 denying app installs you probably have apps that will be broken without 
 GCM.

 Of course, if you have very limited data plans on special purpose
 phones, you may wish for all those apps to be broken - they can use quite 
 a
 bit of data.

 I don't know what GCM's steady-state data rate is for a device.  I
 believe it does a carrier keep-alive ping every 20-30 minutes.  It also
 checks for updates whenever the screen comes on.  Other than that I think
 it is dependent on user or network-originating app traffic.

 R


 On Fri, Dec 21, 2012 at 2:23 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Robert,

 Thank you for the explanation. There's just one more thing that I'd
 like you to help me understand. If we choose to allow the GCM connection,
 what kind of traffic can we expect to have? Like I said previously, we 
 have
 a very tight data plan, so if the GCM connection adds more than just a 
 few
 bytes, that might be a bad idea to enable it. Also, by enabling GCM
 connection, what am I allowing the users to do? Can they use gtalk or
 something else?

 Cheers


 On 21 December 2012 00:17, Robert Greenwalt rgreenw...@google.comwrote:


 The GCM is part of the platform - 3rd party apps depend on it and so
 there's no mechanism for deactivating it.

 If you can

Re: [android-developers] Mobile network idle sockets disconnected

2013-01-28 Thread Robert Greenwalt
I wonder if you don't resolve the DNS if your data use will decline?  You
could test that on an isolated wifi I suppose.


On Mon, Jan 28, 2013 at 8:59 AM, Robert Greenwalt rgreenw...@google.comwrote:

 I don't think you're making your own builds, so you'll have to set the APN
 data on each device (though you probably already have to do this as it's
 not a public apn).  In the apn data set the type of the apn to mms
 instead of default or blank.  Remove any default/blank apn for your
 mcc/mnc pair.

 In your app, you will need to call
 CM.startUsingNetworkFeature(TYPE_MOBILE, enableMMS).  This will turn off
 every 10 minutes (by default - may be different on different phones) so you
 need to call it repeatedly forever perhaps every 9.5 minutes.  Then you
 need to call requestRouteToHost(TYPE_MOBILE_MMS, int addr) for every IP
 addr you're accessing.  Then you should be able to access the servers
 normally.

 R


 On Mon, Jan 28, 2013 at 8:34 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Hi Robert, thanks for such a prompt answer.

 Firstly, it's 3 mb in 3 days, 1mb/day. The DNS resolves the addresses
 correctly, but the connections will fail. Unfortunately I don't have access
 to DNS servers, so it's a bit harder to capture this traffic. I've
 installed Onavo count to capture the traffic, and I can see the usage
 growing up with Android OS.

 The APN idea seems to be a good workaround. Breaking the brower or other
 apps isn't really a problem for us, as this is something very specific. Can
 you tell me where can I find more information on how to do this?

 Cheers


 On 28 January 2013 16:14, Robert Greenwalt rgreenw...@google.com wrote:

 I am curious what the 3mb/day of data consists of if the servers can't
 be reached.  3mb of tcp connect attempts?  DNS lookups?  If it's DNS
 perhaps you could populate your local DNS server with bogus records so that
 the DNS requests die down to be replaced with perhaps fewer failing connect
 attempts?  Can you capture this traffic?

 You could potentially use a different APN type.  Instead of using a
 default type you could put it on type IMS or type MMS.  This will involve a
 bit more work for you, but if you don't a a default connection the other
 apps shouldn't use any data.  This would also mean things like the browser
 won't work.



 On Mon, Jan 28, 2013 at 3:58 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Sorry for reopening this, but I have a consequence behavior with this
 and was hoping for some insights.

 As I said earlier, we are using a very specific APN that allows the
 connection only to a restricted range of servers. I managed to use a
 heartbeat every 5 minutes to workaround the GCM issue, and with the app
 everything is working fine. However, I have another consequence. Because
 the APN restricts access to anything outside our safe little world, the
 system is consuming a whole load of data. Android OS consumed 3 mb in three
 days, Google Services 416 k. In the data settings I was able to restrict
 Google Services (as well as software updates and others) from using data
 but I can't do the same for Android OS. This is killing us completely
 because we have a very restrictive data plans.

 Any ideas on how I can disable data transfer for everything except my
 application?

 Thanks


 On 21 December 2012 15:55, Goncalo Oliveira gonc...@minkan.net wrote:

 Robert,

 Thanks again for clarifying. Basically if I open up GCM I'm allowing
 user to work with gtalk, so I will want to avoid that.
 Looks like sending the heartbeat every 5 minutes is the only option I
 have left.

 Thanks for the help. Much appreciated.
 Cheers


 On 21 December 2012 15:44, Robert Greenwalt rgreenw...@google.comwrote:

 I believe most of the google apps rely on GCM (calendar, gmail,
 contacts, talk, etc), also 3rd party apps that need pushed notifications
 are encouraged to use GCM.  Unless you are making a custom build and
 denying app installs you probably have apps that will be broken without 
 GCM.

 Of course, if you have very limited data plans on special purpose
 phones, you may wish for all those apps to be broken - they can use 
 quite a
 bit of data.

 I don't know what GCM's steady-state data rate is for a device.  I
 believe it does a carrier keep-alive ping every 20-30 minutes.  It also
 checks for updates whenever the screen comes on.  Other than that I think
 it is dependent on user or network-originating app traffic.

 R


 On Fri, Dec 21, 2012 at 2:23 AM, Goncalo Oliveira gonc...@minkan.net
  wrote:

 Robert,

 Thank you for the explanation. There's just one more thing that I'd
 like you to help me understand. If we choose to allow the GCM 
 connection,
 what kind of traffic can we expect to have? Like I said previously, we 
 have
 a very tight data plan, so if the GCM connection adds more than just a 
 few
 bytes, that might be a bad idea to enable it. Also, by enabling GCM
 connection, what am I allowing the users to do? Can they use gtalk or
 something

Re: [android-developers] UnknownHostException is not logged

2013-01-28 Thread Robert Greenwalt
I think a case could also be made for logging the UnknownHostException
without the stack trace (just the server name) as an in between step.
 Thanks for the bugreport.


On Fri, Jan 25, 2013 at 3:08 PM, Boris Burtin bbur...@gmail.com wrote:

 Thanks for responding.  I can see the reasoning.  Just seems weird that
 the behavior isn't documented, and that there's no way for me to override
 it.  I'll file a bug for updating the Javadoc.


 On Friday, January 25, 2013 2:40:10 PM UTC-8, Robert Greenwalt wrote:

 You can always do the dns lookup yourself and log an error if it's
 invalid.  The DNS cache will ensure it's not wasted effort.


 On Fri, Jan 25, 2013 at 2:39 PM, Robert Greenwalt rgree...@google.comwrote:

 I think the log was getting quite full of these exceptions (mobile
 devices often don't have a network and apps aren't so good at checking that
 first) so we stopped logging them.  If you look at the blame for this code
 you can see the reasoning.



 On Fri, Jan 25, 2013 at 2:31 PM, Boris Burtin bbu...@gmail.com wrote:

 I was racking my brain, trying to figure out why one of my users was
 having trouble connecting and nothing was in the logs.  Finally I looked at
 the Android source and realized that the logging code explicitly ignores
 UnknownHostException.  Even worse, the Javadoc doesn't specify this
 behavior.

 Does this sound like a bug to anyone, as opposed to a feature?  In my
 case, the user enters the hostname, so it's possible to get this exception
 while the user has a network connection.

 /**
  * Handy function to get a loggable stack trace from a Throwable
  * @param tr An exception to log
  */
 public static String getStackTraceString(Throwable tr) {
 if (tr == null) {
 return ;
 }

 // This is to reduce the amount of log spew that apps do in the
 non-error
 // condition of the network being unavailable.
 Throwable t = tr;
 while (t != null) {
 if (t instanceof UnknownHostException) {
 return ;
 }
 t = t.getCause();
 }

 StringWriter sw = new StringWriter();
 PrintWriter pw = new PrintWriter(sw);
 tr.printStackTrace(pw);
 return sw.toString();
 }


  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=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




-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] UnknownHostException is not logged

2013-01-25 Thread Robert Greenwalt
I think the log was getting quite full of these exceptions (mobile devices
often don't have a network and apps aren't so good at checking that first)
so we stopped logging them.  If you look at the blame for this code you can
see the reasoning.



On Fri, Jan 25, 2013 at 2:31 PM, Boris Burtin bbur...@gmail.com wrote:

 I was racking my brain, trying to figure out why one of my users was
 having trouble connecting and nothing was in the logs.  Finally I looked at
 the Android source and realized that the logging code explicitly ignores
 UnknownHostException.  Even worse, the Javadoc doesn't specify this
 behavior.

 Does this sound like a bug to anyone, as opposed to a feature?  In my
 case, the user enters the hostname, so it's possible to get this exception
 while the user has a network connection.

 /**
  * Handy function to get a loggable stack trace from a Throwable
  * @param tr An exception to log
  */
 public static String getStackTraceString(Throwable tr) {
 if (tr == null) {
 return ;
 }

 // This is to reduce the amount of log spew that apps do in the
 non-error
 // condition of the network being unavailable.
 Throwable t = tr;
 while (t != null) {
 if (t instanceof UnknownHostException) {
 return ;
 }
 t = t.getCause();
 }

 StringWriter sw = new StringWriter();
 PrintWriter pw = new PrintWriter(sw);
 tr.printStackTrace(pw);
 return sw.toString();
 }

  --
 --
 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




Re: [android-developers] UnknownHostException is not logged

2013-01-25 Thread Robert Greenwalt
You can always do the dns lookup yourself and log an error if it's invalid.
 The DNS cache will ensure it's not wasted effort.


On Fri, Jan 25, 2013 at 2:39 PM, Robert Greenwalt rgreenw...@google.comwrote:

 I think the log was getting quite full of these exceptions (mobile devices
 often don't have a network and apps aren't so good at checking that first)
 so we stopped logging them.  If you look at the blame for this code you can
 see the reasoning.



 On Fri, Jan 25, 2013 at 2:31 PM, Boris Burtin bbur...@gmail.com wrote:

 I was racking my brain, trying to figure out why one of my users was
 having trouble connecting and nothing was in the logs.  Finally I looked at
 the Android source and realized that the logging code explicitly ignores
 UnknownHostException.  Even worse, the Javadoc doesn't specify this
 behavior.

 Does this sound like a bug to anyone, as opposed to a feature?  In my
 case, the user enters the hostname, so it's possible to get this exception
 while the user has a network connection.

 /**
  * Handy function to get a loggable stack trace from a Throwable
  * @param tr An exception to log
  */
 public static String getStackTraceString(Throwable tr) {
 if (tr == null) {
 return ;
 }

 // This is to reduce the amount of log spew that apps do in the
 non-error
 // condition of the network being unavailable.
 Throwable t = tr;
 while (t != null) {
 if (t instanceof UnknownHostException) {
 return ;
 }
 t = t.getCause();
 }

 StringWriter sw = new StringWriter();
 PrintWriter pw = new PrintWriter(sw);
 tr.printStackTrace(pw);
 return sw.toString();
 }

  --
 --
 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




Re: [android-developers] Is it possible to detect the 3g power state?

2013-01-08 Thread Robert Greenwalt
We don't currently get radio power state info.  Sorry.


On Tue, Jan 1, 2013 at 2:33 AM, Sajal Kayan saja...@gmail.com wrote:

 Regarding :
 http://www.research.att.com/export/sites/att_labs/library/image_gallery/articles/2011_Jan-Mar/201103_ARO_state_machine.png

 Is it possible to detect what state the 3g radio is currently in from the
 app?

 I want to know(and log) the state before I do some socket activity to
 better understand what happens when i try to access the network when the
 power is IDLE, FACH, DCH or whatever else.

 If there is an API, and it requires root, I am fine with that. Just need
 to know about to get more insight into 3G performance.

 I tried : logcat -b radio
 But that was information overload, any pointers on what should i grep for
 in it?

 --
 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

Re: [android-developers] Re: Unable to resolve host mysite.com No address associated with hostname

2013-01-08 Thread Robert Greenwalt
The error says that the dns server the device is talking to can't resolve
the name.  It may also mean we can't talk to the dns server.  Can you
resolve other names (google.com, cnn.com, etc)?  Are you on wifi or mobile
data?  Are you talking to a public dns server?  Is your server world
accessible and has its dns record been published?

If this is on a private network you should probably use wifi to give access
to your private dns server and the server itself.

R


On Mon, Jan 7, 2013 at 5:02 PM, Lew lewbl...@gmail.com wrote:

 John Merlino wrote:

 I have a site up and running and I can even connect to it with the
 emulator, and up to an hour ago I was able to connect to it with the
 android device as well. However, now I am suddenly getting this
 message when trying to connect to a URL while testing on the device:

 01-07 17:52:42.650: W/System.err(24859):
 java.net.UnknownHostException: Unable to resolve host mysite.com: No
 address associated with hostname
 01-07 17:52:42.650: W/System.err(24859): at
 java.net.InetAddress.**lookupHostByName(InetAddress.**java:424)
 01-07 17:52:42.650: W/System.err(24859): at
 java.net.InetAddress.**getAllByNameImpl(InetAddress.**java:236)
 01-07 17:52:42.650: W/System.err(24859): at
 java.net.InetAddress.**getAllByName(InetAddress.java:**214)
 01-07 17:52:42.650: W/System.err(24859): at
 org.apache.http.impl.conn.**DefaultClientConnectionOperato**
 r.openConnection(**DefaultClientConnectionOperato**r.java:
 137)

 I tried it with emulator again and emulator still is able to connect
 to host, but the device keeps producing the above error.


 What changed an hour ago?

 You don't give a lot of information here. I'm guessing that the device is
 not connected to the private LAN that has
 the DNS server that resolves the hostname. The emulator shares the network
 connectivity of its host; not so the
 real device.

 You might have to (reverse) tether the device to get it to access the LAN.

 --
 Lew

  --
 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

Re: [android-developers] Android Network Application Service

2013-01-08 Thread Robert Greenwalt
You're not giving enough info here.

Is the server on a private network or is it world routable?

When you say the phone is connected to the PC do you mean tethered,
reverse tethered, simple adb connection, etc?

Is the server running on the PC or elsewhere?

Is the PC network-connected to the server machine?

When the phone is not connected to the PC what network is it phone
connected to?

R


On Wed, Dec 26, 2012 at 3:18 AM, Sathyam Doraswamy 
sathyam.dorasw...@gmail.com wrote:

 I have created an android application that runs a background service that
 does the following :

 1) Asks a UDP server to send 100 packets to it

 2) Receives packets in a while(true) loop

 3) setSoTimeout is used so that the receive times out after 5 minutes and
 gets out of the loop
 The above operations are repeated every 2 minutes. The application works
 totally fine when the phone is connected to the PC and each and every step
 is monitored using adb logcat but the application stops working when the
 phone is disconnected from the PC. Logging each step then in a file shows
 that the last step is the receive step after which the socket does not
 timeout. What could be a possible reason for it? Is there any other
 approach by which I can do the intended task at constant intervals?

 --
 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

Re: [android-developers] Reverse Tether as Standard Android Feature

2013-01-07 Thread Robert Greenwalt
reverse tether through what?  USB?  I think it's a matter of priority.
 Android does support ethernet via USB dongle and that's often more useful
than a usb link.


On Sat, Dec 29, 2012 at 12:38 PM, Jezwin Jebanesan jezwinje...@gmail.comwrote:

 Hello,

 I have been trying to find a reverse tether app for my Android
 device. Unfortunately, all the apps that I found for this purpose requires
 the phone to be rooted. I am not prepared to root my phone as some other
 apps don't work on rooted devices.

 I have been trying to understand why *Reverse Tethering* isn't provided
 as a standard Android feature same as normal tethering? Anyone have any
 ideas?

 (I believe that HTC allows an internet pass through feature, but it isn't
 a standard Android feature).

 Thanks!

 --
 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

Re: [android-developers] Re: using IP address 10.0.2.2 for android simulator works, but how do I point to localhost when testing on android device?

2013-01-04 Thread Robert Greenwalt
I think you can use USB tethering (provided your device/carrier let you)
and use the local ip assigned to the PC's side of the usb link.  Wifi
should also work.


On Fri, Jan 4, 2013 at 2:27 PM, bob b...@coolfone.comze.com wrote:

 Maybe use an Ethernet cable to connect your web server to your Wifi router?


 You need to put the web server on the Wifi LAN.



 On Friday, January 4, 2013 3:58:53 PM UTC-6, John Merlino wrote:

 I have ruby on rails web server that my android application talks to.
 When I connect to 10.0.2.2 on android simulator, it successfully makes
 contact to web server. However, it does not when I test it on the
 actual android device using a usb connection and using eclipse. I am
 forced to use the real live ip address, but I dont want to have to
 deploy live for every little change i need to make when testing on
 device. What options are available?

  --
 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

Re: [android-developers] Re: Use unrooted Android device to test web site running on desktop, through usb cable?

2012-12-26 Thread Robert Greenwalt
I assume Doug meant a wifi network.  I'd agree - that's the easiest.  Some
places don't like random unmanaged wifi AP though.

If you have a modern build there is the potential that it supports ethernet
via a usb dongle.  Most google experience tablets support this.

Another possibility is to use usb tethering.  This is normally used to
connect your laptop to the internet through the phone, but it also sets up
a backchannel route to the laptop.  You should be able to open connections
to the laptop IP (it's dhcp, but you should know what ip it'll get after
your first try).


On Wed, Dec 26, 2012 at 10:13 AM, Doug beafd...@gmail.com wrote:

 The easiest thing is to put them on the same network and point the mobile
 browser to the desktop's IP address and port that is hosting the web server.

 Doug


 On Tuesday, December 25, 2012 4:24:27 PM UTC-5, David Karr wrote:

 If I have an unrooted Android device, a USB cable, and a laptop, can I
 run a web or application server on my laptop and test a site running on
 that server on the Android device?

 I know I can do some testing with the Android emulator, but I'd like
 other options.

  --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-21 Thread Robert Greenwalt
I believe most of the google apps rely on GCM (calendar, gmail, contacts,
talk, etc), also 3rd party apps that need pushed notifications are
encouraged to use GCM.  Unless you are making a custom build and denying
app installs you probably have apps that will be broken without GCM.

Of course, if you have very limited data plans on special purpose phones,
you may wish for all those apps to be broken - they can use quite a bit of
data.

I don't know what GCM's steady-state data rate is for a device.  I believe
it does a carrier keep-alive ping every 20-30 minutes.  It also checks for
updates whenever the screen comes on.  Other than that I think it is
dependent on user or network-originating app traffic.

R


On Fri, Dec 21, 2012 at 2:23 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Thank you for the explanation. There's just one more thing that I'd like
 you to help me understand. If we choose to allow the GCM connection, what
 kind of traffic can we expect to have? Like I said previously, we have a
 very tight data plan, so if the GCM connection adds more than just a few
 bytes, that might be a bad idea to enable it. Also, by enabling GCM
 connection, what am I allowing the users to do? Can they use gtalk or
 something else?

 Cheers


 On 21 December 2012 00:17, Robert Greenwalt rgreenw...@google.com wrote:


 The GCM is part of the platform - 3rd party apps depend on it and so
 there's no mechanism for deactivating it.

 If you can allow the GCM connection to succeed, you should avoid the
 current problems, but if you're going for a secure platform you may not
 want the GCM connection to succeed.

 You could potentially hijack the dns resolution: have your dns server
 report an address you control for mtalk.google.com, then allow
 connections to your own server, but no real functionallity.  With some
 reverse engineering you may be able to get to a quiet connection that
 doesn't trigger these data-stall triggers.

 The easiest solution is to adjust your keep-alive ping to  6 minutes.
  That will effect the battery, but less than allowing the resets to happen.

 I have created internal issues to examine this issue, but even if we
 fixed it today internally you wouldn't see it for a long while.  The first
 issue is to find what traffic is causing this connection reset.  The second
 is to re-eval counting udp packets (I am assuming that's causing part of
 this problem).

 I'm sorry you have hit this issue.

 Robert


 On Thu, Dec 20, 2012 at 4:30 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Any updates on this?

 Cheers


 On 18 December 2012 10:06, Goncalo Oliveira gonc...@minkan.net wrote:

 consider opening up the addre




 --
 Gonçalo Oliveira

 --
 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




 --
 Gonçalo Oliveira

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-20 Thread Robert Greenwalt
The GCM is part of the platform - 3rd party apps depend on it and so
there's no mechanism for deactivating it.

If you can allow the GCM connection to succeed, you should avoid the
current problems, but if you're going for a secure platform you may not
want the GCM connection to succeed.

You could potentially hijack the dns resolution: have your dns server
report an address you control for mtalk.google.com, then allow connections
to your own server, but no real functionallity.  With some reverse
engineering you may be able to get to a quiet connection that doesn't
trigger these data-stall triggers.

The easiest solution is to adjust your keep-alive ping to  6 minutes.
 That will effect the battery, but less than allowing the resets to happen.

I have created internal issues to examine this issue, but even if we fixed
it today internally you wouldn't see it for a long while.  The first issue
is to find what traffic is causing this connection reset.  The second is to
re-eval counting udp packets (I am assuming that's causing part of this
problem).

I'm sorry you have hit this issue.

Robert


On Thu, Dec 20, 2012 at 4:30 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Any updates on this?

 Cheers


 On 18 December 2012 10:06, Goncalo Oliveira gonc...@minkan.net wrote:

 consider opening up the addre




 --
 Gonçalo Oliveira

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-17 Thread Robert Greenwalt
If you have root you can alter the global settings database
(DATA_STALL_ALARM_AGRESSIVE_DELAY_IN_MS,
DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS).


On Mon, Dec 17, 2012 at 4:22 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert, isn't there any way to override the data stall detector behavior?
 or at least change the default value?


 On 17 December 2012 12:02, Goncalo Oliveira gonc...@minkan.net wrote:

 Thanks again for the feedback Robert.

 I'm sending a heartbeat package but an answer is given. Though, I'm only
 sending the heartbeat every 30 minutes. Well, currently I'm doing less than
 that, but only as a workaround for this problem. For the test in case, I'm
 not even sending data. I'm just connecting and listening.
 More information that might be relevant - I ran the test again, but this
 time I'm not even making a connection. I'm just listening to the
 connectivity changes - I was suspecting someone else was causing this.
 Turns out that the same behavior occurs, so someone else is causing this?

 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearing down
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] DcActiveState
 msg.what=EVENT_DISCONNECT RefCount=0
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] tearDownData radio
 is on, call deactivateDataCall
 12-17 11:50:27.951   374  1486 D RILJ: [1903] DEACTIVATE_DATA_CALL 1
 2
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState:
 DISCONNECTING for type default, previous state:CONNECTED
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type mms,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type mms, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] isDataPossible(mms):
 possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn string
 for type:mms
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type cbs,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type cbs, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] isDataPossible(cbs):
 possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn string
 for type:cbs
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] stopNetStatPoll
 12-17 11:50:28.006   374   374 D GSM : [GsmDCT] handleMessage msg={
 what=270368 when=-1ms arg1=1 }
 12-17 11:50:28.576   111   209 D RILClient: processUnsolicited(): resp_id
 (11010), len(59)
 12-17 11:50:28.576   115   194 D RILClient: processUnsolicited(): resp_id
 (11010), len(59)
 12-17 11:50:28.576   756   784 D RILS: Executing Am broadcast -a
 android.intent.action.PROXIMITY_CP --es cmd on
 12-17 11:50:30.576   374   496 D RILJ: [1903] DEACTIVATE_DATA_CALL

 Cheers


 On 14 December 2012 19:58, Robert Greenwalt rgreenw...@google.comwrote:

 oops..  I truncated a sentence..

 updateDataStallInfo logs show what's going on when a stall is detected.
  In your log you can see that 21 packets have been sent since you last
 received a packet.


 On Fri, Dec 14, 2012 at 11:49 AM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 The data stall detector is watching for outgoing packets with no
 corresponding return.  If it sees this for X (6 minute default) it tries a
 bunch of things and one of those steps is to tear down and rebuild the
 connection.  That's what you're seeing.  I believe UDP packets may get
 ignored, thus my tcp/udp question.  You can see some log lines in the radio
 log like updateDataStallInfo: OUT send=... that show what'

 What are you doing in your keepalive pings?  Sending a char with no
 response, or echoing a response back?  That could cause the problem because
 there'd be outgoing traffic but no incoming traffic.  If there were NO
 outgoing the data stall detector shouldn't fire.  If you change your
 keep-alive to send both ways you should be fine.

 This makes me wonder what your other test device is doing - the one
 that doesn't show this problem.  Are you using rooted devices?  They would
 allow you to use tcpdump and look at the network traffic..




 On Fri, Dec 14, 2012 at 11:28 AM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 Interesting.

 Maybe it is an android bug!

 What kind of traffic are you sending?  tcp?  udp?


 On Fri, Dec 14, 2012 at 11:23 AM, Goncalo Oliveira gonc...@minkan.net
  wrote:

 Got the radio logs...

 http

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-17 Thread Robert Greenwalt
Interesting.

If you run a test and take a bugreport you whould be able to look at
QTAGUID STATS INFO in the bugreport.  It shows the packets/bytes sent per
app.  Take a bugreport first, let your device sit for 10 minutes and take
another.  The 4th column is the UID of the app and you should be able to
figure our who is responsible for the data.

R


On Mon, Dec 17, 2012 at 7:00 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert, some more information that might be relevant.
 As I told you, I was using a sim card that connects through our own APN,
 that restricts access to our servers.
 Today I decided to try the same scenario with a different SIM, so I
 plugged a generic 3G sim card, without the APN restrictions. The result
 was that I no longer had the stall problem... Could any Android background
 service be failing to connect and giving this outcome?
 Also, browsing the web I found this issue:
 http://code.google.com/p/android/issues/detail?id=35856  might it be
 related?

 Cheers



 On 17 December 2012 12:22, Goncalo Oliveira gonc...@minkan.net wrote:

 Robert, isn't there any way to override the data stall detector behavior?
 or at least change the default value?


 On 17 December 2012 12:02, Goncalo Oliveira gonc...@minkan.net wrote:

 Thanks again for the feedback Robert.

 I'm sending a heartbeat package but an answer is given. Though, I'm only
 sending the heartbeat every 30 minutes. Well, currently I'm doing less than
 that, but only as a workaround for this problem. For the test in case, I'm
 not even sending data. I'm just connecting and listening.
 More information that might be relevant - I ran the test again, but this
 time I'm not even making a connection. I'm just listening to the
 connectivity changes - I was suspecting someone else was causing this.
 Turns out that the same behavior occurs, so someone else is causing this?

 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearing down
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] DcActiveState
 msg.what=EVENT_DISCONNECT RefCount=0
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] tearDownData radio
 is on, call deactivateDataCall
 12-17 11:50:27.951   374  1486 D RILJ: [1903] DEACTIVATE_DATA_CALL
 1 2
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState:
 DISCONNECTING for type default, previous state:CONNECTED
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type mms,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type mms, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] isDataPossible(mms):
 possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn
 string for type:mms
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type cbs,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type cbs, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] isDataPossible(cbs):
 possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn
 string for type:cbs
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] stopNetStatPoll
 12-17 11:50:28.006   374   374 D GSM : [GsmDCT] handleMessage msg={
 what=270368 when=-1ms arg1=1 }
 12-17 11:50:28.576   111   209 D RILClient: processUnsolicited():
 resp_id (11010), len(59)
 12-17 11:50:28.576   115   194 D RILClient: processUnsolicited():
 resp_id (11010), len(59)
 12-17 11:50:28.576   756   784 D RILS: Executing Am broadcast -a
 android.intent.action.PROXIMITY_CP --es cmd on
 12-17 11:50:30.576   374   496 D RILJ: [1903] DEACTIVATE_DATA_CALL

 Cheers


 On 14 December 2012 19:58, Robert Greenwalt rgreenw...@google.comwrote:

 oops..  I truncated a sentence..

 updateDataStallInfo logs show what's going on when a stall is detected.
  In your log you can see that 21 packets have been sent since you last
 received a packet.


 On Fri, Dec 14, 2012 at 11:49 AM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 The data stall detector is watching for outgoing packets with no
 corresponding return.  If it sees this for X (6 minute default) it tries a
 bunch of things and one of those steps is to tear down and rebuild the
 connection.  That's what you're seeing.  I believe UDP packets may get
 ignored, thus my tcp/udp question.  You can see some log lines in the 
 radio
 log like updateDataStallInfo: OUT send

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-17 Thread Robert Greenwalt
I don't think so.  This is not designed for users to tweak.

If you can figure out who is sending data we might be able to do something.

R


On Mon, Dec 17, 2012 at 8:34 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 What if I don't have root access? Is there anything else I can do?


 On 17 December 2012 16:08, Robert Greenwalt rgreenw...@google.com wrote:

 If you have root you can alter the global settings database
 (DATA_STALL_ALARM_AGRESSIVE_DELAY_IN_MS,
 DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS).


 On Mon, Dec 17, 2012 at 4:22 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert, isn't there any way to override the data stall detector
 behavior? or at least change the default value?


 On 17 December 2012 12:02, Goncalo Oliveira gonc...@minkan.net wrote:

 Thanks again for the feedback Robert.

 I'm sending a heartbeat package but an answer is given. Though, I'm
 only sending the heartbeat every 30 minutes. Well, currently I'm doing less
 than that, but only as a workaround for this problem. For the test in case,
 I'm not even sending data. I'm just connecting and listening.
 More information that might be relevant - I ran the test again, but
 this time I'm not even making a connection. I'm just listening to the
 connectivity changes - I was suspecting someone else was causing this.
 Turns out that the same behavior occurs, so someone else is causing this?

 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearing down
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] DcActiveState
 msg.what=EVENT_DISCONNECT RefCount=0
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] tearDownData radio
 is on, call deactivateDataCall
 12-17 11:50:27.951   374  1486 D RILJ: [1903] DEACTIVATE_DATA_CALL
 1 2
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState:
 DISCONNECTING for type default, previous state:CONNECTED
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type mms,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type mms, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT]
 isDataPossible(mms): possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn
 string for type:mms
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type cbs,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type cbs, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT]
 isDataPossible(cbs): possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn
 string for type:cbs
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] stopNetStatPoll
 12-17 11:50:28.006   374   374 D GSM : [GsmDCT] handleMessage msg={
 what=270368 when=-1ms arg1=1 }
 12-17 11:50:28.576   111   209 D RILClient: processUnsolicited():
 resp_id (11010), len(59)
 12-17 11:50:28.576   115   194 D RILClient: processUnsolicited():
 resp_id (11010), len(59)
 12-17 11:50:28.576   756   784 D RILS: Executing Am broadcast -a
 android.intent.action.PROXIMITY_CP --es cmd on
 12-17 11:50:30.576   374   496 D RILJ: [1903] DEACTIVATE_DATA_CALL

 Cheers


 On 14 December 2012 19:58, Robert Greenwalt rgreenw...@google.comwrote:

 oops..  I truncated a sentence..

 updateDataStallInfo logs show what's going on when a stall is
 detected.  In your log you can see that 21 packets have been sent since 
 you
 last received a packet.


 On Fri, Dec 14, 2012 at 11:49 AM, Robert Greenwalt 
 rgreenw...@google.com wrote:

 The data stall detector is watching for outgoing packets with no
 corresponding return.  If it sees this for X (6 minute default) it tries 
 a
 bunch of things and one of those steps is to tear down and rebuild the
 connection.  That's what you're seeing.  I believe UDP packets may get
 ignored, thus my tcp/udp question.  You can see some log lines in the 
 radio
 log like updateDataStallInfo: OUT send=... that show what'

 What are you doing in your keepalive pings?  Sending a char with no
 response, or echoing a response back?  That could cause the problem 
 because
 there'd be outgoing traffic but no incoming traffic.  If there were NO
 outgoing the data stall detector shouldn't fire.  If you change your
 keep-alive to send both ways you should be fine.

 This makes me wonder what your other test device is doing - the one
 that doesn't show this problem.  Are you using rooted

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-17 Thread Robert Greenwalt
You could try using the UI in the Settings Data usage screen, but it's
going to be hard to select a small enough time slice.  Perhaps if you left
it for a while so you had a bigger window to work from.


On Mon, Dec 17, 2012 at 9:01 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Guess I need a rooted device for that...

 -- QTAGUID STATS INFO (su root cat /proc/net/xt_qtaguid/stats) --

 *** exec(su): Permission denied


 On 17 December 2012 16:33, Robert Greenwalt rgreenw...@google.com wrote:

 Interesting.

 If you run a test and take a bugreport you whould be able to look at
 QTAGUID STATS INFO in the bugreport.  It shows the packets/bytes sent per
 app.  Take a bugreport first, let your device sit for 10 minutes and take
 another.  The 4th column is the UID of the app and you should be able to
 figure our who is responsible for the data.

 R


 On Mon, Dec 17, 2012 at 7:00 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert, some more information that might be relevant.
 As I told you, I was using a sim card that connects through our own APN,
 that restricts access to our servers.
 Today I decided to try the same scenario with a different SIM, so I
 plugged a generic 3G sim card, without the APN restrictions. The result
 was that I no longer had the stall problem... Could any Android background
 service be failing to connect and giving this outcome?
 Also, browsing the web I found this issue:
 http://code.google.com/p/android/issues/detail?id=35856  might it be
 related?

 Cheers



 On 17 December 2012 12:22, Goncalo Oliveira gonc...@minkan.net wrote:

 Robert, isn't there any way to override the data stall detector
 behavior? or at least change the default value?


 On 17 December 2012 12:02, Goncalo Oliveira gonc...@minkan.net wrote:

 Thanks again for the feedback Robert.

 I'm sending a heartbeat package but an answer is given. Though, I'm
 only sending the heartbeat every 30 minutes. Well, currently I'm doing 
 less
 than that, but only as a workaround for this problem. For the test in 
 case,
 I'm not even sending data. I'm just connecting and listening.
 More information that might be relevant - I ran the test again, but
 this time I'm not even making a connection. I'm just listening to the
 connectivity changes - I was suspecting someone else was causing this.
 Turns out that the same behavior occurs, so someone else is causing this?

 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.951   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearing down
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] DcActiveState
 msg.what=EVENT_DISCONNECT RefCount=0
 12-17 11:50:27.951   374  1486 D GSM : [GsmDC-1] tearDownData
 radio is on, call deactivateDataCall
 12-17 11:50:27.951   374  1486 D RILJ: [1903]
 DEACTIVATE_DATA_CALL 1 2
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState:
 DISCONNECTING for type default, previous state:CONNECTED
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type mms,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type mms, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT]
 isDataPossible(mms): possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn
 string for type:mms
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] set reason as
 pdpReset, for type cbs,current state IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] cleanUpConnection:
 tearDown=true reason=pdpReset
 12-17 11:50:27.959   374   374 D GSM : [ApnContext] setState: IDLE
 for type cbs, previous state:IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT]
 isDataPossible(cbs): possible=true isDataAllowed=true apnTypePossible=true
 apnContextisEnabled=false apnContextState()=IDLE
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] get active apn
 string for type:cbs
 12-17 11:50:27.959   374   374 D GSM : [GsmDCT] stopNetStatPoll
 12-17 11:50:28.006   374   374 D GSM : [GsmDCT] handleMessage
 msg={ what=270368 when=-1ms arg1=1 }
 12-17 11:50:28.576   111   209 D RILClient: processUnsolicited():
 resp_id (11010), len(59)
 12-17 11:50:28.576   115   194 D RILClient: processUnsolicited():
 resp_id (11010), len(59)
 12-17 11:50:28.576   756   784 D RILS: Executing Am broadcast -a
 android.intent.action.PROXIMITY_CP --es cmd on
 12-17 11:50:30.576   374   496 D RILJ: [1903]
 DEACTIVATE_DATA_CALL

 Cheers


 On 14 December 2012 19:58, Robert Greenwalt rgreenw...@google.comwrote:

 oops..  I truncated a sentence..

 updateDataStallInfo logs show what's going on when a stall is
 detected.  In your log you can see that 21 packets have been sent since

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-17 Thread Robert Greenwalt
I'll try this here as well and see if I can repro the problem on a rooted
device.


On Mon, Dec 17, 2012 at 9:20 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Fred,

 Just to clarify, I haven't declined the heartbeat option. I just would
 like to avoid low timestamps such as every 5 minute.
 I'm trying to identify what's happening behind the scenes like Robert
 suggested, as it seems that it's not just my app that throws this stall.
 I'll post my results as soon as possible.


 On 17 December 2012 17:03, Fred Niggle fred.nig...@googlemail.com wrote:

 Well, just to recap:

 You know that android is not supposed to keep an idle connection open for
 an extended period.
 Also you have declined the option to  use of a heartbeat to keep the
 connection open.

 You also know that GCM (C2DM) have a way of keeping in touch.

 At this point the main(only?) route to pursue is to look over the GCM
 libs from google and see how they do it.

 Best regards,
 Fred


 On 17 December 2012 16:49, Goncalo Oliveira gonc...@minkan.net wrote:

 Fred,

 I do understand that this is not a standard for most android apps.
 Therefore, there are a number of scenarios, like Mark pointed out. In this
 case, the connection is also used for data pushing. Polling would be much
 simpler, but it does not fit the required scenario.


 On 17 December 2012 16:43, Mark Murphy mmur...@commonsware.com wrote:

 On Mon, Dec 17, 2012 at 11:37 AM, Fred Niggle
 fred.nig...@googlemail.com wrote:
  I am wondering why you are trying to maintain an idle connection?

 You would do this for any sort of push delivery from the server:
 standard push notifications, VOIP for incoming calls, etc.

 So, for example, C2DM used to have this sort of heartbeat logic, and I
 presume GCM does too.

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

 Aqui estão alguns sites onde você pode perguntar ou responder dúvidas
 sobre desenvolvimento de aplicações para Android:
 http://www.andglobe.com

 --
 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




 --
 Gonçalo Oliveira

 --
 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




 --
 Sent from an Ubuntu Desktop.

 Ubuntu Speech 
 inputhttps://play.google.com/store/apps/details?id=com.nds.ubuntuspeechinputis
  now available on Google Play, along with Magnetic
 Door Alarm 
 apphttps://play.google.com/store/apps/details?id=com.nds.magneticdooralarm
 .

 --
 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




 --
 Gonçalo Oliveira

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-17 Thread Robert Greenwalt
It seems we switched our traffic stats strategy recently (JB) and now UDP
packets are getting included when they arguably shouldn't be.  If your DNS
server is disconnected from the internet and can't resolve the
mtalk.google.com queries you'll end up with outgoing queries and no
responses.  This will cause the resets you see every 6 minutes.  If the DNS
is resolving, then we probably have some other packet slipping out with no
return.

A couple questions:
Is your production environment going to be this isloated?  Gtalk is what's
providing the GCM channel that many 3rd party apps need.

Why aren't you using GCM?  It provides a push notification system for apps,
and by sharing it you get better battery life and have less development
headache.

I'm trying to contact the gcm/gtalk team to find out if there's a non-root
way to turn off the service, but I'm not hopeful.

R


On Mon, Dec 17, 2012 at 10:13 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Can't get QTAGUID STATS INFO on samsung. On the other device also fails
 retrieving that info. I'm going to try to get another device.
 Meanwhile, I published the whole bugreport output, maybe you can see
 something that I can't...

 https://www.dropbox.com/sh/18o32mndge2rrpd/vAeETMVnh6

 Cheers


 On 17 December 2012 17:46, Goncalo Oliveira gonc...@minkan.net wrote:

 Robert,

 Kind of a wild guess but... GTalkService?

 logcat
 12-17 17:14:47.212   473  1312 E *GTalkService: connectionClosed: no
 XMPPConnection - That's strange*!
 12-17 17:14:47.220   213   223 E AlarmManagerService:
 android_server_AlarmManagerService_set to type=2, 4627.14900
 12-17 17:14:47.665   292   292 D STATUSBAR-NetworkController:
 onServiceStateChanged state=0
 12-17 17:14:47.673   292   292 W SignalStrength: getGsmLevel=3
 12-17 17:14:47.673   292   292 W SignalStrength: getLevel=3
 (SignalStrength: 99 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 3)
 12-17 17:14:47.673   292   292 D StatusBar.NetworkController:
 getDataServiceState : NoSuchMethodException
 12-17 17:14:47.673   213   988 D STATUSBAR-NotificationService:
 cancelNotification - pkg:com.android.systemui, id:273, tag:null
 12-17 17:14:47.689  3183  3183 D StatusChecker: onReceive :
 android.intent.action.SERVICE_STATE
 12-17 17:14:47.689  3183  3183 D StatusChecker: Service state changed : 0
 12-17 17:14:47.689   292   292 D STATUSBAR-NetworkController:
 onDataConnectionStateChanged: state=2 type=3

 radio
 12-17 17:15:49.618   371   371 D GSM : [GsmDCT] updateDataStallInfo:
 OUT sent=12 mSentSinceLastRecv=29
 12-17 17:15:49.626   371   371 D GSM : [GsmDCT] onDataStallAlarm:
 tag=24748 do recovery action=1
 12-17 17:15:49.626   371   371 D GSM : [GsmDCT] handleMessage msg={
 what=270354 when=-3ms }
 12-17 17:15:49.626   371   371 D GSM : [GsmDCT] overall state is
 CONNECTED
 12-17 17:15:49.626   371   371 D GSM : [GsmDCT] doRecovery() cleanup
 all connections

 SERVICE com.google.android.gsf/.gtalkservice.service.GTalkService
 12-17 17:15:08.158   473   473 D GTalkService: [ReconnectMgr]
 setInternalNetworkState: type=0, state=CONNECTED
 12-17 17:15:08.158   473   473 I GTalkService/c:
 [AndroidEndpoint@1093684528] connect: acct=100, state=CONNECTING
 12-17 17:15:08.168   473  1312 D GTalkService/c:
 [AndroidEndpoint@1093684528] doConnectDelegate: making main connection
 12-17 17:15:08.168   473  1312 D Smack: [SSLXMPPConnection@1094231880]
 create socket connection(mtalk.google.com, 5228)
 12-17 17:15:52.215   473  1312 D GTalkService:
 [AndroidEndpoint@1093684528] doConnect: caught XMPPError connecting to
 mtalk.google.com:5228.: (502)
   -- caused by: java.net.ConnectException: failed to connect to
 mtalk.google.com/173.194.78.188 (port 5228): connect failed: ETIMEDOUT
 (Connection timed out)
 12-17 17:15:52.215   473  1312 D GTalkService/c:
 [AndroidEndpoint@1093684528] handleDoConnectError for 100, error=2,
 xmppError=null
 12-17 17:15:52.215   473  1312 D GTalkService/c:
 [AndroidEndpoint@1093684528] closeConnection for 100, notify=true,
 xmppConn=null
 12-17 17:15:52.216   473  1312 E GTalkService: connectionClosed: no
 XMPPConnection - That's strange!
 12-17 17:15:52.216   473  1312 D GTalkService: [ReconnectMgr] ###
 report Inet status: online=false, networkType=0

 like I said, kind of a wild guess. I'll try to replicate here with
 another device also (rooted), as in this one I can't get the QTAGUID STATS.

 Cheers


 On 17 December 2012 17:24, Robert Greenwalt rgreenw...@google.comwrote:

 I'll try this here as well and see if I can repro the problem on a
 rooted device.


 On Mon, Dec 17, 2012 at 9:20 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Fred,

 Just to clarify, I haven't declined the heartbeat option. I just would
 like to avoid low timestamps such as every 5 minute.
 I'm trying to identify what's happening behind the scenes like Robert
 suggested, as it seems that it's not just my app that throws this stall.
 I'll post my

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-14 Thread Robert Greenwalt
Android is not supposed to do this, though there is no guarantee of
connectivity.  It sounds like something samsung is doing, either
accidentally or on purpose.

If you send a packet every 6 minutes does that keep the device from pulsing
connectivity?

Can you take a bugreport - the radio log may have some indication of why
it's happening.


On Fri, Dec 14, 2012 at 2:24 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Hi all,

 Seems that Android is dropping idle sockets when under a mobile network.
 Usually, no socket is kept alive for more than 7 minutes of inactivity. I
 am using a SIM card with a particular APN, that allows idle sockets for at
 least 30 minutes - this was tested using another kind of device, also
 communicating with GSM, and there are no drops, so problem isn't the SIM
 card.

 After a few searches in the web, I tried a few approaches to work around
 this, but until now, no success. I tried using a partial wake lock after
 connecting, releasing only when disconnected - didn't work. Also tried
 using only a 2G network, as some said that changing from network type could
 impact on this - same outcome.

 After digging a bit more and by analyzing logcat, I watched that a 
 CONNECTIVITY_CHANGE
 is sent after some idle time, disabling the data transfer availability
 (active network is mobile, no connectivity) and another one is sent
 enabling it again (active network is mobile, connectivity). This cuts off
 all live socket connections.

 Investigating a little bit more, I also observed that this behavior is not
 consistent through all Android versions, or maybe (even worse) through
 different hardware. Connectivity break is occurring in a Galaxy Tab 7
 with Android 4.0.4. The same isn't occurring in an Unitech TB 100 with
 Android 3.2.

 Does anyone know where I can get more information and/or I can work around
 this? I would really like to avoid sending heartbeats every 6/7 minutes.


 Cheers

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-14 Thread Robert Greenwalt
Is it possible something else on the device is occasionally sending data
and reseting your window?

I would look in the log for the timestamp of the ConnectivityChanged
broadcast and then check the radio log and see what's going on.

I suspect there is an unsolicited data call list notification coming from
the radio showing that the data call has gone away.  Perhaps just before
that there may be something explaining why.

You may have to contact samsung if you're sure that other devices have
longer connection times on the same carrier.


On Fri, Dec 14, 2012 at 8:30 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Hi Robert,

 Thanks for the reply. If I send a packet every 5/6 minutes the
 connectivity is maintained yes. Only if connection is idle for longer than
 that. The weird thing is that it's not an exact timer, even though the
 average is very close. Sometimes it lasts 7 minutes, sometimes 8 or 9. I
 even saw this happening with a 4 minute interval, though very rarely. On
 the other device, I can most of the times maintain higher idle times.
 I'll try to look at the logs more carefully to see if there's something
 else. Is there anything in particular that I should look for?

 Cheers


 On 14 December 2012 16:16, Robert Greenwalt rgreenw...@google.com wrote:

 Android is not supposed to do this, though there is no guarantee of
 connectivity.  It sounds like something samsung is doing, either
 accidentally or on purpose.

 If you send a packet every 6 minutes does that keep the device from
 pulsing connectivity?

 Can you take a bugreport - the radio log may have some indication of why
 it's happening.


 On Fri, Dec 14, 2012 at 2:24 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Hi all,

 Seems that Android is dropping idle sockets when under a mobile network.
 Usually, no socket is kept alive for more than 7 minutes of inactivity. I
 am using a SIM card with a particular APN, that allows idle sockets for at
 least 30 minutes - this was tested using another kind of device, also
 communicating with GSM, and there are no drops, so problem isn't the SIM
 card.

 After a few searches in the web, I tried a few approaches to work around
 this, but until now, no success. I tried using a partial wake lock after
 connecting, releasing only when disconnected - didn't work. Also tried
 using only a 2G network, as some said that changing from network type could
 impact on this - same outcome.

 After digging a bit more and by analyzing logcat, I watched that a 
 CONNECTIVITY_CHANGE
 is sent after some idle time, disabling the data transfer availability
 (active network is mobile, no connectivity) and another one is sent
 enabling it again (active network is mobile, connectivity). This cuts off
 all live socket connections.

 Investigating a little bit more, I also observed that this behavior is
 not consistent through all Android versions, or maybe (even worse) through
 different hardware. Connectivity break is occurring in a Galaxy Tab 7
 with Android 4.0.4. The same isn't occurring in an Unitech TB 100 with
 Android 3.2.

 Does anyone know where I can get more information and/or I can work
 around this? I would really like to avoid sending heartbeats every 6/7
 minutes.


 Cheers

 --
 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




 --
 Gonçalo Oliveira

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-14 Thread Robert Greenwalt
3319 is fine.  It's just the tethering code noting an interface is going
away.

Can you get radio logs?  This is the system log - there are several log
buffers.  A bugreport (adb bugreport  mybug.txt) would get them all.  Then
you can match the connectivityservice dropout with what happened in the
radio.

I don't think you should open a bug: this is not an android issue, but
rather it's a samsung issue.

I have opened an internal issue to expand CTS to check for this - any
device wanting to claim to be an android device would not be allowed to do
such a thing in the future.


On Fri, Dec 14, 2012 at 10:08 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Thanks again for the feedback. I traced the logs from samsung with a
 simple app to reproduce this behavior. Same thing, 6/7 minutes and it drops.
 I posted the logs here: http://pastebin.com/FcPPbq3V
 On line 3323 you can see ConnectivityService disconnecting. What I can't
 understand is what's causing it. Line 3319 is suspicious as I don't have
 tethering on, but other than that I can't really determine what causes
 this. Should I open a bug for this?

 Cheers


 On 14 December 2012 16:50, Robert Greenwalt rgreenw...@google.com wrote:

 Is it possible something else on the device is occasionally sending data
 and reseting your window?

 I would look in the log for the timestamp of the ConnectivityChanged
 broadcast and then check the radio log and see what's going on.

 I suspect there is an unsolicited data call list notification coming from
 the radio showing that the data call has gone away.  Perhaps just before
 that there may be something explaining why.

 You may have to contact samsung if you're sure that other devices have
 longer connection times on the same carrier.


 On Fri, Dec 14, 2012 at 8:30 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Hi Robert,

 Thanks for the reply. If I send a packet every 5/6 minutes the
 connectivity is maintained yes. Only if connection is idle for longer than
 that. The weird thing is that it's not an exact timer, even though the
 average is very close. Sometimes it lasts 7 minutes, sometimes 8 or 9. I
 even saw this happening with a 4 minute interval, though very rarely. On
 the other device, I can most of the times maintain higher idle times.
 I'll try to look at the logs more carefully to see if there's something
 else. Is there anything in particular that I should look for?

 Cheers


 On 14 December 2012 16:16, Robert Greenwalt rgreenw...@google.comwrote:

 Android is not supposed to do this, though there is no guarantee of
 connectivity.  It sounds like something samsung is doing, either
 accidentally or on purpose.

 If you send a packet every 6 minutes does that keep the device from
 pulsing connectivity?

 Can you take a bugreport - the radio log may have some indication of
 why it's happening.


 On Fri, Dec 14, 2012 at 2:24 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Hi all,

 Seems that Android is dropping idle sockets when under a mobile
 network. Usually, no socket is kept alive for more than 7 minutes of
 inactivity. I am using a SIM card with a particular APN, that allows idle
 sockets for at least 30 minutes - this was tested using another kind of
 device, also communicating with GSM, and there are no drops, so problem
 isn't the SIM card.

 After a few searches in the web, I tried a few approaches to work
 around this, but until now, no success. I tried using a partial wake lock
 after connecting, releasing only when disconnected - didn't work. Also
 tried using only a 2G network, as some said that changing from network 
 type
 could impact on this - same outcome.

 After digging a bit more and by analyzing logcat, I watched that a 
 CONNECTIVITY_CHANGE
 is sent after some idle time, disabling the data transfer availability
 (active network is mobile, no connectivity) and another one is sent
 enabling it again (active network is mobile, connectivity). This cuts off
 all live socket connections.

 Investigating a little bit more, I also observed that this behavior is
 not consistent through all Android versions, or maybe (even worse) through
 different hardware. Connectivity break is occurring in a Galaxy Tab 7
 with Android 4.0.4. The same isn't occurring in an Unitech TB 100 with
 Android 3.2.

 Does anyone know where I can get more information and/or I can work
 around this? I would really like to avoid sending heartbeats every 6/7
 minutes.


 Cheers

 --
 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

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-14 Thread Robert Greenwalt
Interesting.

Maybe it is an android bug!

What kind of traffic are you sending?  tcp?  udp?


On Fri, Dec 14, 2012 at 11:23 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Got the radio logs...

 http://pastebin.com/754wJ2jd

 This seems to be it
 GSM : [GsmDCT] onReceive:
 action=com.android.internal.telephony.gprs-data-stall


 On 14 December 2012 18:25, Robert Greenwalt rgreenw...@google.com wrote:

 3319 is fine.  It's just the tethering code noting an interface is going
 away.

 Can you get radio logs?  This is the system log - there are several log
 buffers.  A bugreport (adb bugreport  mybug.txt) would get them all.  Then
 you can match the connectivityservice dropout with what happened in the
 radio.

 I don't think you should open a bug: this is not an android issue, but
 rather it's a samsung issue.

 I have opened an internal issue to expand CTS to check for this - any
 device wanting to claim to be an android device would not be allowed to do
 such a thing in the future.


 On Fri, Dec 14, 2012 at 10:08 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Robert,

 Thanks again for the feedback. I traced the logs from samsung with a
 simple app to reproduce this behavior. Same thing, 6/7 minutes and it drops.
 I posted the logs here: http://pastebin.com/FcPPbq3V
 On line 3323 you can see ConnectivityService disconnecting. What I can't
 understand is what's causing it. Line 3319 is suspicious as I don't have
 tethering on, but other than that I can't really determine what causes
 this. Should I open a bug for this?

 Cheers


 On 14 December 2012 16:50, Robert Greenwalt rgreenw...@google.comwrote:

 Is it possible something else on the device is occasionally sending
 data and reseting your window?

 I would look in the log for the timestamp of the ConnectivityChanged
 broadcast and then check the radio log and see what's going on.

 I suspect there is an unsolicited data call list notification coming
 from the radio showing that the data call has gone away.  Perhaps just
 before that there may be something explaining why.

 You may have to contact samsung if you're sure that other devices have
 longer connection times on the same carrier.


 On Fri, Dec 14, 2012 at 8:30 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Hi Robert,

 Thanks for the reply. If I send a packet every 5/6 minutes the
 connectivity is maintained yes. Only if connection is idle for longer than
 that. The weird thing is that it's not an exact timer, even though the
 average is very close. Sometimes it lasts 7 minutes, sometimes 8 or 9. I
 even saw this happening with a 4 minute interval, though very rarely. On
 the other device, I can most of the times maintain higher idle times.
 I'll try to look at the logs more carefully to see if there's
 something else. Is there anything in particular that I should look for?

 Cheers


 On 14 December 2012 16:16, Robert Greenwalt rgreenw...@google.comwrote:

 Android is not supposed to do this, though there is no guarantee of
 connectivity.  It sounds like something samsung is doing, either
 accidentally or on purpose.

 If you send a packet every 6 minutes does that keep the device from
 pulsing connectivity?

 Can you take a bugreport - the radio log may have some indication of
 why it's happening.


 On Fri, Dec 14, 2012 at 2:24 AM, Goncalo Oliveira gonc...@minkan.net
  wrote:

 Hi all,

 Seems that Android is dropping idle sockets when under a mobile
 network. Usually, no socket is kept alive for more than 7 minutes of
 inactivity. I am using a SIM card with a particular APN, that allows 
 idle
 sockets for at least 30 minutes - this was tested using another kind of
 device, also communicating with GSM, and there are no drops, so problem
 isn't the SIM card.

 After a few searches in the web, I tried a few approaches to work
 around this, but until now, no success. I tried using a partial wake 
 lock
 after connecting, releasing only when disconnected - didn't work. Also
 tried using only a 2G network, as some said that changing from network 
 type
 could impact on this - same outcome.

 After digging a bit more and by analyzing logcat, I watched that a 
 CONNECTIVITY_CHANGE
 is sent after some idle time, disabling the data transfer availability
 (active network is mobile, no connectivity) and another one is sent
 enabling it again (active network is mobile, connectivity). This cuts 
 off
 all live socket connections.

 Investigating a little bit more, I also observed that this behavior
 is not consistent through all Android versions, or maybe (even worse)
 through different hardware. Connectivity break is occurring in a
 Galaxy Tab 7 with Android 4.0.4. The same isn't occurring in an Unitech 
 TB
 100 with Android 3.2.

 Does anyone know where I can get more information and/or I can work
 around this? I would really like to avoid sending heartbeats every 6/7
 minutes.


 Cheers

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-14 Thread Robert Greenwalt
The data stall detector is watching for outgoing packets with no
corresponding return.  If it sees this for X (6 minute default) it tries a
bunch of things and one of those steps is to tear down and rebuild the
connection.  That's what you're seeing.  I believe UDP packets may get
ignored, thus my tcp/udp question.  You can see some log lines in the radio
log like updateDataStallInfo: OUT send=... that show what'

What are you doing in your keepalive pings?  Sending a char with no
response, or echoing a response back?  That could cause the problem because
there'd be outgoing traffic but no incoming traffic.  If there were NO
outgoing the data stall detector shouldn't fire.  If you change your
keep-alive to send both ways you should be fine.

This makes me wonder what your other test device is doing - the one that
doesn't show this problem.  Are you using rooted devices?  They would allow
you to use tcpdump and look at the network traffic..




On Fri, Dec 14, 2012 at 11:28 AM, Robert Greenwalt rgreenw...@google.comwrote:

 Interesting.

 Maybe it is an android bug!

 What kind of traffic are you sending?  tcp?  udp?


 On Fri, Dec 14, 2012 at 11:23 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Got the radio logs...

 http://pastebin.com/754wJ2jd

 This seems to be it
 GSM : [GsmDCT] onReceive:
 action=com.android.internal.telephony.gprs-data-stall


 On 14 December 2012 18:25, Robert Greenwalt rgreenw...@google.comwrote:

 3319 is fine.  It's just the tethering code noting an interface is going
 away.

 Can you get radio logs?  This is the system log - there are several log
 buffers.  A bugreport (adb bugreport  mybug.txt) would get them all.  Then
 you can match the connectivityservice dropout with what happened in the
 radio.

 I don't think you should open a bug: this is not an android issue, but
 rather it's a samsung issue.

 I have opened an internal issue to expand CTS to check for this - any
 device wanting to claim to be an android device would not be allowed to do
 such a thing in the future.


 On Fri, Dec 14, 2012 at 10:08 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Robert,

 Thanks again for the feedback. I traced the logs from samsung with a
 simple app to reproduce this behavior. Same thing, 6/7 minutes and it 
 drops.
 I posted the logs here: http://pastebin.com/FcPPbq3V
 On line 3323 you can see ConnectivityService disconnecting. What I
 can't understand is what's causing it. Line 3319 is suspicious as I don't
 have tethering on, but other than that I can't really determine what causes
 this. Should I open a bug for this?

 Cheers


 On 14 December 2012 16:50, Robert Greenwalt rgreenw...@google.comwrote:

 Is it possible something else on the device is occasionally sending
 data and reseting your window?

 I would look in the log for the timestamp of the ConnectivityChanged
 broadcast and then check the radio log and see what's going on.

 I suspect there is an unsolicited data call list notification coming
 from the radio showing that the data call has gone away.  Perhaps just
 before that there may be something explaining why.

 You may have to contact samsung if you're sure that other devices have
 longer connection times on the same carrier.


 On Fri, Dec 14, 2012 at 8:30 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Hi Robert,

 Thanks for the reply. If I send a packet every 5/6 minutes the
 connectivity is maintained yes. Only if connection is idle for longer 
 than
 that. The weird thing is that it's not an exact timer, even though the
 average is very close. Sometimes it lasts 7 minutes, sometimes 8 or 9. I
 even saw this happening with a 4 minute interval, though very rarely. On
 the other device, I can most of the times maintain higher idle times.
 I'll try to look at the logs more carefully to see if there's
 something else. Is there anything in particular that I should look for?

 Cheers


 On 14 December 2012 16:16, Robert Greenwalt rgreenw...@google.comwrote:

 Android is not supposed to do this, though there is no guarantee of
 connectivity.  It sounds like something samsung is doing, either
 accidentally or on purpose.

 If you send a packet every 6 minutes does that keep the device from
 pulsing connectivity?

 Can you take a bugreport - the radio log may have some indication of
 why it's happening.


 On Fri, Dec 14, 2012 at 2:24 AM, Goncalo Oliveira 
 gonc...@minkan.net wrote:

 Hi all,

 Seems that Android is dropping idle sockets when under a mobile
 network. Usually, no socket is kept alive for more than 7 minutes of
 inactivity. I am using a SIM card with a particular APN, that allows 
 idle
 sockets for at least 30 minutes - this was tested using another kind of
 device, also communicating with GSM, and there are no drops, so problem
 isn't the SIM card.

 After a few searches in the web, I tried a few approaches to work
 around this, but until now, no success. I tried using a partial wake 
 lock
 after connecting, releasing only when disconnected

Re: [android-developers] Mobile network idle sockets disconnected

2012-12-14 Thread Robert Greenwalt
oops..  I truncated a sentence..

updateDataStallInfo logs show what's going on when a stall is detected.  In
your log you can see that 21 packets have been sent since you last received
a packet.


On Fri, Dec 14, 2012 at 11:49 AM, Robert Greenwalt rgreenw...@google.comwrote:

 The data stall detector is watching for outgoing packets with no
 corresponding return.  If it sees this for X (6 minute default) it tries a
 bunch of things and one of those steps is to tear down and rebuild the
 connection.  That's what you're seeing.  I believe UDP packets may get
 ignored, thus my tcp/udp question.  You can see some log lines in the radio
 log like updateDataStallInfo: OUT send=... that show what'

 What are you doing in your keepalive pings?  Sending a char with no
 response, or echoing a response back?  That could cause the problem because
 there'd be outgoing traffic but no incoming traffic.  If there were NO
 outgoing the data stall detector shouldn't fire.  If you change your
 keep-alive to send both ways you should be fine.

 This makes me wonder what your other test device is doing - the one that
 doesn't show this problem.  Are you using rooted devices?  They would allow
 you to use tcpdump and look at the network traffic..




 On Fri, Dec 14, 2012 at 11:28 AM, Robert Greenwalt 
 rgreenw...@google.comwrote:

 Interesting.

 Maybe it is an android bug!

 What kind of traffic are you sending?  tcp?  udp?


 On Fri, Dec 14, 2012 at 11:23 AM, Goncalo Oliveira gonc...@minkan.netwrote:

 Got the radio logs...

 http://pastebin.com/754wJ2jd

 This seems to be it
 GSM : [GsmDCT] onReceive:
 action=com.android.internal.telephony.gprs-data-stall


 On 14 December 2012 18:25, Robert Greenwalt rgreenw...@google.comwrote:

 3319 is fine.  It's just the tethering code noting an interface is
 going away.

 Can you get radio logs?  This is the system log - there are several log
 buffers.  A bugreport (adb bugreport  mybug.txt) would get them all.  Then
 you can match the connectivityservice dropout with what happened in the
 radio.

 I don't think you should open a bug: this is not an android issue, but
 rather it's a samsung issue.

 I have opened an internal issue to expand CTS to check for this - any
 device wanting to claim to be an android device would not be allowed to do
 such a thing in the future.


 On Fri, Dec 14, 2012 at 10:08 AM, Goncalo Oliveira 
 gonc...@minkan.netwrote:

 Robert,

 Thanks again for the feedback. I traced the logs from samsung with a
 simple app to reproduce this behavior. Same thing, 6/7 minutes and it 
 drops.
 I posted the logs here: http://pastebin.com/FcPPbq3V
 On line 3323 you can see ConnectivityService disconnecting. What I
 can't understand is what's causing it. Line 3319 is suspicious as I don't
 have tethering on, but other than that I can't really determine what 
 causes
 this. Should I open a bug for this?

 Cheers


 On 14 December 2012 16:50, Robert Greenwalt rgreenw...@google.comwrote:

 Is it possible something else on the device is occasionally sending
 data and reseting your window?

 I would look in the log for the timestamp of the ConnectivityChanged
 broadcast and then check the radio log and see what's going on.

 I suspect there is an unsolicited data call list notification coming
 from the radio showing that the data call has gone away.  Perhaps just
 before that there may be something explaining why.

 You may have to contact samsung if you're sure that other devices
 have longer connection times on the same carrier.


 On Fri, Dec 14, 2012 at 8:30 AM, Goncalo Oliveira gonc...@minkan.net
  wrote:

 Hi Robert,

 Thanks for the reply. If I send a packet every 5/6 minutes the
 connectivity is maintained yes. Only if connection is idle for longer 
 than
 that. The weird thing is that it's not an exact timer, even though the
 average is very close. Sometimes it lasts 7 minutes, sometimes 8 or 9. I
 even saw this happening with a 4 minute interval, though very rarely. On
 the other device, I can most of the times maintain higher idle times.
 I'll try to look at the logs more carefully to see if there's
 something else. Is there anything in particular that I should look for?

 Cheers


 On 14 December 2012 16:16, Robert Greenwalt 
 rgreenw...@google.comwrote:

 Android is not supposed to do this, though there is no guarantee of
 connectivity.  It sounds like something samsung is doing, either
 accidentally or on purpose.

 If you send a packet every 6 minutes does that keep the device from
 pulsing connectivity?

 Can you take a bugreport - the radio log may have some indication
 of why it's happening.


 On Fri, Dec 14, 2012 at 2:24 AM, Goncalo Oliveira 
 gonc...@minkan.net wrote:

 Hi all,

 Seems that Android is dropping idle sockets when under a mobile
 network. Usually, no socket is kept alive for more than 7 minutes of
 inactivity. I am using a SIM card with a particular APN, that allows 
 idle
 sockets for at least 30 minutes - this was tested using another

Re: [android-developers] Reduce Battery Usage via Airplane Mode

2012-11-29 Thread Robert Greenwalt
It an interesting idea.

Note that toggling APM will consume more power than maintaining a
connection for some period.  If APM is on for long enough you can make this
a positive change.  If you have no coverage, it's definitely a positive
change.  Of course your texting, chatting, location services, basically
everything you have a smartphone for will be broken during that time - you
may as well have the phone off.  Even phone calls will fail during that
time.  Turning APM off may also be slow.  In some situations it may take
30s or longer to get a data connection, and then apps need to reconnect and
check for updates.

I'll enter a feature request.


On Tue, Nov 27, 2012 at 9:16 AM, Javo eq...@live.com wrote:


 I've never created an android app, however I am a computer science major
 (sophomore), so I am relatively familiar with some java code. However, I'm
 still new to programming so forgive me if I say anything ignorant.

 I have noticed that the less service I have, the more battery power that
 is used to search for service.
 My ultimate goal is to create an app that will put my phone on Airplane
 mode when it is locked and periodically turn off Airplane mode every X
 minutes.
 The purpose of putting the phone on Airplane Mode when it is locked is to
 prevent the phone from using battery searching for service when I am not
 using it.
 The purpose of turning off Airplane Mode every X minutes is to allow my
 phone to update, by searching and hopefully connecting to a network so
 that I can be alerted of any missed text messages and/or calls that I have
 received since being on airplane mode.
 If the phone is unlocked, I would like Airplane mode to be turned off.

 Ideally, I would rather not have to write this code at all. I would really
 appreciate it if someone else could write it for me, not because I am lazy,
 but because this is an app that my phone desperately needs because I spend
 a lot of time in areas where I have too little service for the phone to
 effectively use the networks to send information, but just enough service
 that my phone can still receive information from senders (texts/emails).
 -Thank you to whomever may be able to help me.


  --
 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

Re: [android-developers] Android Maps Navigation Tethering..

2012-11-27 Thread Robert Greenwalt
You could use a tethering link for p2p connections, but you'd probably be
better off using a wifi direct link instead - it's made for p2p and has api
for finding the ip address of the other side.

As for your question about the highlighted bit:
Turn wifi tethering on on phone (settings - wirelessnetworks,more -
Tethering  portable hotspot - Setup Wifi hotspot - enter a network ssid,
save, Portable Wifi hotspot.

Next on the tablet connect to the wifi network you named above.

Launch maps


Robert


On Tue, Nov 27, 2012 at 5:27 AM, Karunakaran Vikash kvk2551...@gmail.comwrote:

 Hi.
   Previously i have created an application in Android that.. I had created
 an TCP client and server communication between two android mobiles through
 wifi protocol by means of handshaking theri Ipaddress. But i couldnt able
 to communicate, once one of the Android mobile was kept in wifi Tethering
 mode.Why it is like that ? if i am wrong in it. then could please say the
 reason for that.


 *
 Yes, you can use maps on a tablet tethered through wifi to an android
 phone to get data*

  if the highlighted is possible could you please say how to perform it.  I
 need your help plz. Example code is der na.. share with me..


 On Tuesday, November 27, 2012 12:03:35 AM UTC+5:30, Robert Greenwalt wrote:

 I don't understand the point of your email.  Do you have a question?
  Your one use of ? isn't really a question.

 Yes, you can use maps on a tablet tethered through wifi to an android
 phone to get data.

 R


 On Mon, Nov 26, 2012 at 1:30 AM, Karunakaran Vikash 
 kvk25...@gmail.comwrote:

 Hi ,
i need to use  a Network Data usage of Android mobile device by
 another android Tablet. think of this scenario , I am having a two Android
 devices, one is a mobile and another is Tablet. I am having an application
 in tablet such as Navigation  MusicPlayer. Navigation(Maps) is Done by
 using the datausage of the android Mobile.I dont have option to put SIM in
 my Tablet.
   Whether TCP communication is established between a Android Mobile
 and Tablet for streaming the songs ??  Android Mobile will be in
 thethering Mode.Till I studied, there is socket   address itself not
 generating for me in thethering mode mobile..



 any refrences, plz help.
 Thanks in advance..
 Thanks  Regards,
 v.Karunakaran

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=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


-- 
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] Android Maps Navigation Tethering..

2012-11-26 Thread Robert Greenwalt
I don't understand the point of your email.  Do you have a question?  Your
one use of ? isn't really a question.

Yes, you can use maps on a tablet tethered through wifi to an android phone
to get data.

R


On Mon, Nov 26, 2012 at 1:30 AM, Karunakaran Vikash kvk2551...@gmail.comwrote:

 Hi ,
i need to use  a Network Data usage of Android mobile device by
 another android Tablet. think of this scenario , I am having a two Android
 devices, one is a mobile and another is Tablet. I am having an application
 in tablet such as Navigation  MusicPlayer. Navigation(Maps) is Done by
 using the datausage of the android Mobile.I dont have option to put SIM in
 my Tablet.
   Whether TCP communication is established between a Android Mobile
 and Tablet for streaming the songs ??  Android Mobile will be in
 thethering Mode.Till I studied, there is socket   address itself not
 generating for me in thethering mode mobile..



 any refrences, plz help.
 Thanks in advance..
 Thanks  Regards,
 v.Karunakaran

 --
 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

Re: [android-developers] Re: Network error IOException while trying to Sync Data From SQL Server

2012-11-16 Thread Robert Greenwalt
You are doing ethernet over usb and then trying to talk to the connected
pc?  Is the pc running dhcp?  Can you take a bugreport or use adb shell to
check your interfaces and route table?  It may be easier to put a wifi AP
on this private network and connect that way..


On Thu, Nov 15, 2012 at 11:07 PM, Aadi Rockzz sakzk...@gmail.com wrote:


 Hi Sunghun,

 The Device is Connected to my System(That's in Same network) via USB. Is
 there any settings needs to be establish in Android Device. And my
 SQLServer has private IP.
 Please help me by guiding to solve this issue.

 Best Regards,
 Aadi

 --
 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

Re: [android-developers] Re: (Http)URLConnection.setUseCaches(false) isn't working

2012-11-02 Thread Robert Greenwalt
Even if this is a carrier issue, please let us know - we'd like the
carriers to do the right thing and do have some contacts to explore issues
like this.

Kieth, was this on mobile data or on wifi (or other)?


On Fri, Nov 2, 2012 at 7:06 AM, bob b...@coolfone.comze.com wrote:

 Are you using WiFi or your phone's data connection?


 I saw this strange issue with this Origami Iris game where it would
 somehow load a page from the cache if I used my MetroPCS connection.
 Didn't happen on Wifi though.  Very weird.



 On Friday, November 2, 2012 1:27:38 AM UTC-5, Keith Wiley wrote:

 A few weeks ago I mentioned that I was experiencing unwanted http caching
 (I mentioned it here because I wasn't sure if the cause of the problem was
 the Android OS performing the caching in a way that didn't make sense to
 me).  At the time, it was suggested that I experiment with getUseCaches()
 and setUseCaches().  This has definitely not solved the problem.  First of
 all, it does indeed appear that caching is enabled by default (as is
 GZipping the stream interestingly, I think I've read about this
 somewhere).  However, setting caching false doesn't help.  Not only does my
 app not confidently load an updated version of the file from the server,
 but it doesn't even detect that the file is gone from the server (if I
 change its name for example).  Rather, the app still happily retrieves the
 cached version of the file, even though I'm calling setUseCaches(false).
 Does anyone have any thoughts on how else to fix this problem?  I know
 there is a solution because the phone's web browser app (actually, I'm
 using Dolphin) properly loads the server version of the file every time.

 Once again, I don't mean to bring this up on an Android forum if it
 really isn't an Android issue...but I'm not sure whether the problem is
 coming from the Android system for some reason (I'm not sure whether I
 should expect my code to work in any other Java environment, just not
 Android).  Where else might the cache be coming from if the URLConnection's
 useCaches variable is definitely false (verified as I step over
 setUseCaches(false) in the debugger)?

 I'm sorry if this is off-topic, I appreciate any help.  Here's how I load
 the file:

 String address = httpUrlOfFileOnMyWebserver;
 URL url = new URL(address);
 HttpURLConnection conn = (HttpURLConnection) url.openConnection();
 if (conn.getUseCaches())
 conn.setUseCaches(false);
 InputStream is = (InputStream)conn.getContent()**;
 Reader reader = new InputStreamReader(is, UTF-8);
 StringWriter writer = new StringWriter();
 char[] buffer = new char[1024];
 for (int length = 0; (length = reader.read(buffer))  0;)
 writer.write(buffer, 0, length);
 is.close();
 reader.close();
 writer.close();
 String fileStr = writer.toString();

  --
 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

Re: [android-developers] Re: how to solve the error UnknownHostException

2012-10-30 Thread Robert Greenwalt
Are you sure the host publishes its address to the dns server you're using?


On Fri, Oct 19, 2012 at 1:49 PM, Sterling Michel Diaz De Oleo 
sterlingdi...@gmail.com wrote:

 Hi Bob. thanks for answering.
 It's need to have the host name because the server was made in SAP and
 sadly that's does not allow that.
 I tried that too, and it gave me an error.

 El viernes, 19 de octubre de 2012 16:40:32 UTC-4, bob escribió:

 As a quick stopgap solution, why not just use the IP address instead of
 the hostname?


 Sounds like there is something awry with the DNS.



 On Friday, October 19, 2012 2:03:43 PM UTC-5, SoftMan wrote:

 I can ping the server and I am not under a proxi. Please, help!

  --
 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

Re: [android-developers] Unable to register CONNECTIVITY_ACTION in a service

2012-10-04 Thread Robert Greenwalt
You are registering in your constructor.  I think you need to register in
onCreate.  You appear to not have a context when your constructor is called.



On Wed, Oct 3, 2012 at 9:17 PM, Subodh Nijsure subodh.nijs...@gmail.comwrote:

 Hello Robert,

 Below is the stack trace that I see when system catches the exception:

 Not sure if you had any chance glancing at my sample code on original
 email, and see if anything obviously wrong there?

 I/System.out(12738): java.lang.NullPointerException
 I/System.out(12738):at
 android.content.ContextWrapper.registerReceiver(ContextWrapper.java:341)
 I/System.out(12738):at
 com.mycompany.ScsService.ScsService.init(ScsService.java:50)
 I/System.out(12738):at java.lang.Class.newInstanceImpl(Native Method)
 I/System.out(12738):at java.lang.Class.newInstance(Class.java:1319)
 I/System.out(12738):at
 android.app.ActivityThread.handleCreateService(ActivityThread.java:2234)
 I/System.out(12738):at
 android.app.ActivityThread.access$1600(ActivityThread.java:123)
 I/System.out(12738):at
 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
 I/System.out(12738):at
 android.os.Handler.dispatchMessage(Handler.java:99)
 I/System.out(12738):at android.os.Looper.loop(Looper.java:137)
 I/System.out(12738):at
 android.app.ActivityThread.main(ActivityThread.java:4424)
 I/System.out(12738):at java.lang.reflect.Method.invokeNative(Native
 Method)
 I/System.out(12738):at java.lang.reflect.Method.invoke(Method.java:511)
 I/System.out(12738):at

 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
 I/System.out(12738):at
 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
 I/System.out(12738):at dalvik.system.NativeStart.main(Native Method)

 -Subodh

 On Wed, Oct 3, 2012 at 7:39 AM, Robert Greenwalt rgreenw...@google.com
 wrote:
  Checking network types explicitly like this is bad - what happens if the
  device is connected through a bluetooth tether or via ethernet adapter?
 
  You could use getActiveNetworkInfo() and check it's connection, but this
 is
  still polling.  If you need to get notified when a connection comes or
 goes
  (have something to do on next connect, for example) The
 CONNECTIVITY_ACTION
  broadcast intent is the way to go.  Note that this can be chatty - there
 are
  several secondary networks that currently cause this broadcast that you
 may
  have to weed out.  You should use getActiveNetworkInfo in your handler to
  find the state that applies to you.
 
  Can you post the stack trace of the NPE?
 
  R
 
 
  On Wed, Oct 3, 2012 at 5:46 AM, Rahul Kaushik rahulkaushi...@gmail.com
  wrote:
 
  hi subodh
 
  try this
 
  package com.FranConnectMobile;
 
  import java.io.BufferedReader;
  import java.io.InputStreamReader;
  import java.net.URL;
  import android.app.Activity;
  import android.content.Context;
  import android.net.ConnectivityManager;
 
 
 
 
  public class chkInternet extends Activity
  {
  public  boolean isInternetAvailable(Context context){
  ConnectivityManager connec = (ConnectivityManager)
  context.getSystemService(Context.CONNECTIVITY_SERVICE);
  android.net.NetworkInfo wifi =
  connec.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
  android.net.NetworkInfo mobile =
  connec.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
 
  if(wifi.isConnected() || mobile.isConnected()){
  // Check for web site
  try{
  // Create a URL for the desired page
  URL url = new URL(http://www.google.com;);
  // Read all the text returned by the server
  BufferedReader in = new BufferedReader(new
  InputStreamReader(url.openStream()));
  in.close();
  return true;
  } catch (Exception e) {
  return false;
  }
  }
 
  return false;
  }
 
  }
 
  TX
  RK
 
  On Wed, Oct 3, 2012 at 6:08 PM, Subodh Nijsure 
 subodh.nijs...@gmail.com
  wrote:
 
  Hello,
 
  I am trying to implement a service that is supposed to download stuff
  from a cloud service. So I want this service to be notified whenever
  phone/tablet looses network connectivity.
 
 
  So I implemented code that looks like this:
 
  receiver = new ConnectivityReceiver();
  filter = new IntentFilter();
 
  filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
  try {
  Intent i = registerReceiver(receiver,
  filter);
  }
  catch (Exception e) {
  
  }
  However when I have this code in a class that extends a Service
  registerReciver always throws a NullPointerException.
 
  However the same code in a class that extends an activity does not
 throw
  such an exception. I have attached my manifest file and the full code

Re: [android-developers] Unable to register CONNECTIVITY_ACTION in a service

2012-10-03 Thread Robert Greenwalt
Checking network types explicitly like this is bad - what happens if the
device is connected through a bluetooth tether or via ethernet adapter?

You could use getActiveNetworkInfo() and check it's connection, but this is
still polling.  If you need to get notified when a connection comes or goes
(have something to do on next connect, for example) The CONNECTIVITY_ACTION
broadcast intent is the way to go.  Note that this can be chatty - there
are several secondary networks that currently cause this broadcast that you
may have to weed out.  You should use getActiveNetworkInfo in your handler
to find the state that applies to you.

Can you post the stack trace of the NPE?

R


On Wed, Oct 3, 2012 at 5:46 AM, Rahul Kaushik rahulkaushi...@gmail.comwrote:

 hi subodh

 try this

 package com.FranConnectMobile;

 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.net.URL;
 import android.app.Activity;
 import android.content.Context;
 import android.net.ConnectivityManager;




 public class chkInternet extends Activity
 {
  public  boolean isInternetAvailable(Context context){
 ConnectivityManager connec = (ConnectivityManager)
 context.getSystemService(Context.CONNECTIVITY_SERVICE);
 android.net.NetworkInfo wifi =
 connec.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
 android.net.NetworkInfo mobile =
 connec.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);

 if(wifi.isConnected() || mobile.isConnected()){
 // Check for web site
 try{
 // Create a URL for the desired page
 URL url = new URL(http://www.google.com;);
 // Read all the text returned by the server
 BufferedReader in = new BufferedReader(new
 InputStreamReader(url.openStream()));
 in.close();
 return true;
 } catch (Exception e) {
 return false;
 }
 }

 return false;
 }

  }

 TX
 RK

 On Wed, Oct 3, 2012 at 6:08 PM, Subodh Nijsure 
 subodh.nijs...@gmail.comwrote:

 Hello,

 I am trying to implement a service that is supposed to download stuff
 from a cloud service. So I want this service to be notified whenever
 phone/tablet looses network connectivity.


 So I implemented code that looks like this:

 receiver = new ConnectivityReceiver();
 filter = new IntentFilter();
 filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
 try {
 Intent i = registerReceiver(receiver,
 filter);
 }
 catch (Exception e) {
 
 }
 However when I have this code in a class that extends a Service
 registerReciver always throws a NullPointerException.

 However the same code in a class that extends an activity does not throw
 such an exception. I have attached my manifest file and the full code for
 the service template. Would appreciate any pointers as to why this works in
 activity and not in a service.

 Or is there any better way for a service that run in the background to
 know when device looses/gains (IP) network connectivity?

 Regards,
 -Subodh

 --
 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

Re: [android-developers] closing mobile network on galaxy s3

2012-10-03 Thread Robert Greenwalt
It's generally better to just turn off mobile data:  settings -Mobile
networks - Data Enabled.  Messing with the APN works on most carriers, but
if you ever want it back you have to un-garble it.


On Wed, Oct 3, 2012 at 12:50 AM, Salih Gündüz gunduz.sa...@gmail.comwrote:

 I cahnged the gsm values for mobile intgernet I write some random values.
 and I solved it. thanks


 On Sat, Sep 22, 2012 at 11:44 PM, Harri Smått har...@gmail.com wrote:

 Hi,

 Are you on ICS? If yes (this may apply to other Android versions too),
 you can switch packet data off from mobile network settings and disable
 use packet data. Did this help you out?

 --
 H

 On Sep 22, 2012, at 11:34 PM, Salih Gündüz gunduz.sa...@gmail.com
 wrote:

  I can not close the mobile network on my phone. I want to connect
 internet only by wi-fi. not gsm. I select option/mobile mode/ only gsm. but
 not working. it seems gsm-wcmdahow can I change it.
 

 --
 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] Center a CheckBox?

2012-10-03 Thread Robert Greenwalt
I have a CheckBox (without text) in a table layout.  I'm trying to center
it horizontally.  The crude Padding method fails to work: adding left
padding does nothing.  The center_horizontal gravity does nothing.  Putting
it in a RelativeLayout in the cell doesn't seem to help.

What's the right way to do this and how should I have figured out the
proper combo?

Thanks

R

-- 
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] using color.xml definitions in string.xml

2012-09-21 Thread Robert Greenwalt
Is there a syntax that allows me to reference a color defined in color.xml
in my string.xml file?

I can do:
string name=my_stringfont fgcolor=#ff90STRING: /font/string

but hardcoding is bad.  I'd really like to do:
string name=my_stringfont fgcolor=@color/my_color_defintionSTRING:
/font/string

but that doesn't work, nor does fgcolor=@color/mycolor_definition

-- 
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] download the files from where it left off if the internet connection goes down?

2012-09-10 Thread Robert Greenwalt
How about using the built in support:

http://developer.android.com/reference/android/app/DownloadManager.html


On Tue, Sep 4, 2012 at 3:46 AM, RichardC richard.crit...@googlemail.comwrote:

 yes

 http://stackoverflow.com/questions/3414438/java-resume-download-in-urlconnection



 On Tuesday, September 4, 2012 9:31:39 AM UTC+1, asheesh arya wrote:

 no

  --
 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

Re: [android-developers] Abnormal tip sorry,process com.google.process.gapps has stopped popup very often.

2012-09-10 Thread Robert Greenwalt
Sorry - I was out of the office for a while.  I'm surprised nobody else
jumped in to help.

Your original post included a nice log of the crash.

Searching for has died turns up:

I/ActivityManager(  260): Process com.google.process.gapps (pid 609) has died.

So that tells you that process 609 was the one that crashed.  Searching
backwards from there for 609 gives:

E/AndroidRuntime(  609): FATAL EXCEPTION: SyncAdapterThread-1
E/AndroidRuntime(  609): java.lang.IllegalArgumentException: Invalid
column _count
E/AndroidRuntime(  609):at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:166)
E/AndroidRuntime(  609):at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
E/AndroidRuntime(  609):at
android.content.ContentProviderProxy.query(ContentProviderNative.java:358)
E/AndroidRuntime(  609):at
android.content.ContentProviderClient.query(ContentProviderClient.java:50)
E/AndroidRuntime(  609):at
com.google.android.syncadapters.contacts.ContactsSyncAdapter.getCount(ContactsSyncAdapter.java:678)
E/AndroidRuntime(  609):at
com.google.android.syncadapters.contacts.ContactsSyncAdapter.processLocalChanges(ContactsSyncAdapter.java:721)
E/AndroidRuntime(  609):at
com.google.android.syncadapters.contacts.ContactsSyncAdapter.innerPerformSync(ContactsSyncAdapter.java:321)
E/AndroidRuntime(  609):at
com.google.android.syncadapters.contacts.ContactsSyncAdapter.onPerformLoggedSync(ContactsSyncAdapter.java:180)
E/AndroidRuntime(  609):at
com.google.android.common.LoggingThreadedSyncAdapter.onPerformSync(LoggingThreadedSyncAdapter.java:33)
E/AndroidRuntime(  609):at
android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:247)

Going backwards from there shows some Contact DB queries and
references to a TypeBContactsWidget.  Is that your code?


R



On Wed, Aug 22, 2012 at 1:12 AM, Maheswar Martha
marthamahes...@gmail.comwrote:

 Hi Robert,

 Thanks for the reply.

 No, we have not flashed a different version or replaced with older version
 of GAPPS.
 To confirm this we erased all the data by factory reset and then loaded
 the fresh software(APPS and MODEM builds).
 But, still the problem is reproducible. The bug report is attached here.

 I searched the android frameworks code for this sorry... message, but
 not found source location.
 Do you have any idea about the source code from where we do pop up this 
 sorry,process
 com.google.process.gapps has stopped message?

 The real problem we are facing no crash logs when the message popup. Do
 you suggest any method to debug this kind of problems?

 If you need any information , please let me know.
 We will be waiting for your response.

 Thanks,
 Maheswar Martha


 On Thursday, August 16, 2012 9:28:13 PM UTC+5:30, Robert Greenwalt wrote:

 Have you done anything to the device like flash a different version or
 accept an OTA update?

 This often happens when you go backwards to a previous version because we
 support database upgrades but not downgrades.

 A good idea in these cases is to use adb to capture a bugreport and see
 what crashed.


 On Tue, Aug 14, 2012 at 5:52 AM, Maheswar Martha martham...@gmail.comwrote:

 Hi,

 Below abnormal tip is popping up while performing sync of gmail/google+.

 sorry,process com.google.process.gapps has stopped  ( See the attached
 image)

 Problem reproduction procedure:

 sorry,process com.google.process.gapps has stopped


 We didn’t get any crash logs like tombstones or traces.txt.

 The only traces observed in logcat(find the logcat log in the
 attachment):**

 ** **

 I/ActivityManager(  260): Process com.google.process.gapps (pid 609) has
 died.

 ** **

 I/ActivityManager(  260): Kill com.google.android.youtube (pid 3167):
 provider com.google.android.gsf.**settings.**GoogleSettingsProvider in
 dying process com.google.process.gapps



 1. What could be reason for the problem?

 2. Do we have any fixes for this issue? If yes, can you provide the fix
 details.

 3. any workaround?



 Thanks in advance.



 /Maheswar Martha





 ** **

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**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=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


-- 
You received this message

Re: [android-developers] Android as a tool for enterprise solution and internet connectivity

2012-08-21 Thread Robert Greenwalt
Remove market and browser and youtube from your build?


On Tue, Aug 21, 2012 at 6:57 AM, Aizzat Suhardi aizzat.suha...@gmail.comwrote:

 Hi,

 I'm building a set of android apps built for Android phone that will be
 solely used by workers during their working shifts.

 Are there any way for me to disable the internet browsing facility and
 other entertainment(ie: Youtube) but i still need the internet connection
 for the android apps i developed to send information data/logs back to my
 online data servers.

 Thank you.

 --
 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

Re: [android-developers] Abnormal tip sorry,process com.google.process.gapps has stopped popup very often.

2012-08-16 Thread Robert Greenwalt
Have you done anything to the device like flash a different version or
accept an OTA update?

This often happens when you go backwards to a previous version because we
support database upgrades but not downgrades.

A good idea in these cases is to use adb to capture a bugreport and see
what crashed.


On Tue, Aug 14, 2012 at 5:52 AM, Maheswar Martha
marthamahes...@gmail.comwrote:

 Hi,

 Below abnormal tip is popping up while performing sync of gmail/google+.

 sorry,process com.google.process.gapps has stopped  ( See the attached
 image)

 Problem reproduction procedure:

 sorry,process com.google.process.gapps has stopped


 We didn’t get any crash logs like tombstones or traces.txt.

 The only traces observed in logcat(find the logcat log in the attachment):
 **

 ** **

 I/ActivityManager(  260): Process com.google.process.gapps (pid 609) has
 died.

 ** **

 I/ActivityManager(  260): Kill com.google.android.youtube (pid 3167):
 provider com.google.android.gsf.settings.GoogleSettingsProvider in dying
 process com.google.process.gapps



 1. What could be reason for the problem?

 2. Do we have any fixes for this issue? If yes, can you provide the fix
 details.

 3. any workaround?



 Thanks in advance.



 /Maheswar Martha





 ** **

 --
 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

  1   2   >