[android-developers] Re: NDK TCP Server/Client Help

2013-06-11 Thread dani maoz
Solved A Casting needed
 if (connect(sockfd, (struct sockaddr *) &serveraddr, sizeof(serveraddr)) <
0)
   perror("connect failed");

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




[android-developers] NDK TCP Server/Client Help

2013-06-11 Thread dani maoz
Hi
I would like to implement a TCP Server/client using NDK, can anyone post on
example or an ndk project.
Another Question
i implemented an TCP server but when the client connect gethostbyaddr
return NULL any idea
See below the code


childfd = accept(parentfd, (struct sockaddr *) &clientaddr, &clientlen);
 if (childfd < 0)
  printf("ERROR on accept");
/*
 * gethostbyaddr: determine who sent the message
 */
hostp = gethostbyaddr((const char *)&clientaddr.sin_addr.s_addr,
  sizeof(clientaddr.sin_addr.s_addr), AF_INET);
if (hostp == NULL) {
  printf("ERROR on gethostbyaddr\n");
  return 0;

}

printf("Test1\n");
 hostaddrp = inet_ntoa(clientaddr.sin_addr);
if (hostaddrp == NULL)
  printf("ERROR on inet_ntoa\n");

printf("server established connection with %s (%s)\n",
   hostp->h_name, hostaddrp);

/*
 * read: read input string from the client
 */
bzero(buf, BUFSIZE);
 n = read(childfd, buf, BUFSIZE);
if (n < 0)
  printf("ERROR reading from socket");

printf("server received %d bytes: %s", n, buf);

/*
 * write: echo the input string back to the client
 */
n = write(childfd, buf, strlen(buf));
if (n < 0)
  printf("ERROR writing to socket");

-- 
-- 
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 can I upload translated descriptions of an android app to the developer console?

2013-06-11 Thread Mathieu
I think you are sadly right... T_T
I don't see this kind of feature. Anywhere, anyhow ...

Thanks anyway ;)


On Wednesday, June 12, 2013 1:17:39 AM UTC-4, TreKing wrote:
>
>
> On Tue, Jun 11, 2013 at 9:55 PM, Mathieu 
> > wrote:
>
>> Any idea or solution please ?
>
>
> Contact the Google Play support and make a feature request then wait 
> patiently for a few years. ;)
>
>
> -
> TreKing  - Chicago 
> transit tracking app for Android-powered 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.




Re: [android-developers] How can I upload translated descriptions of an android app to the developer console?

2013-06-11 Thread TreKing
On Tue, Jun 11, 2013 at 9:55 PM, Mathieu  wrote:

> Any idea or solution please ?


Contact the Google Play support and make a feature request then wait
patiently for a few years. ;)

-
TreKing  - Chicago
transit tracking app for Android-powered 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.




Re: [android-developers] How can I upload translated descriptions of an android app to the developer console?

2013-06-11 Thread Mathieu
Well, the idea is to upload descriptions, not copy/paste.
Because I have more than 30 apps and 10 translated languages for each app...

So the idea would be either to include the description in the manifest (and 
the description in the manifest would be used byt the console) either to 
upload the translations to the console...

Any idea or solution please ?

On Tuesday, June 11, 2013 10:20:09 PM UTC-4, TreKing wrote:
>
>
> On Tue, Jun 11, 2013 at 2:20 PM, Mathieu 
> > wrote:
>
>> How can I upload the descriptions directly to the developer console ?
>
>
> I don't think you can upload - it's just text, copy and paste.
>
>
> -
> TreKing  - Chicago 
> transit tracking app for Android-powered 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.




Re: [android-developers] How can I upload translated descriptions of an android app to the developer console?

2013-06-11 Thread TreKing
On Tue, Jun 11, 2013 at 2:20 PM, Mathieu  wrote:

> How can I upload the descriptions directly to the developer console ?


I don't think you can upload - it's just text, copy and paste.

-
TreKing  - Chicago
transit tracking app for Android-powered 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.




Re: [android-developers] Google Api Route

2013-06-11 Thread TreKing
On Tue, Jun 11, 2013 at 4:05 AM, Carlos Calvo <1caca...@gmail.com> wrote:

> One question for google api route
>
> You're on the wrong forum. This group is for Android Development.

-
TreKing  - Chicago
transit tracking app for Android-powered 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.




[android-developers] ProGuard fails on PhoneGap sample project

2013-06-11 Thread Andrew
I've posted a couple of times on the phonegap forum about this, but I 
haven't got any response, so I hope maybe someone here can help me. 

First off, I know that ProGuard does not obfuscate the js and html in a 
PhoneGap app. My app has a significant amount of native code as well, so 
I'm trying to follow Google's publishing checklist and add obfuscation. 
I'll provide links to my earlier posts at the end for anyone who wants more 
detail, so I'll try to keep this short.

My app runs fine when built without ProGuard, but when I enable ProGuard, I 
can't even get it to build without a ton of warnings, and those warnings 
cause the build to fail. I can get the build to finish only if I use a 
directive to ignore warnings. But then the resulting .apk does not work. 
What seems to be the case is that the *deviceready* event is never 
delivered to the Phonegap *WebView* -- at least the javascript listener 
appears to never get it. In an attempt to narrow down the cause, I created 
an unmodified PhoneGap sample project, and found essentially the same 
behavior.

Building the sample app unmodified produces:

[2013-06-11 16:19:23 - HelloPhoneGap_280] Proguard returned with error code 
1. See console
[2013-06-11 16:19:23 - HelloPhoneGap_280] Note: there were 86 duplicate 
class definitions.
[2013-06-11 16:19:23 - HelloPhoneGap_280] Warning: 
org.apache.cordova.CordovaWebView$Level16Apis: can't find referenced method 
'void setAllowUniversalAccessFromFileURLs(boolean)' in class 
android.webkit.WebSettings
[2013-06-11 16:19:23 - HelloPhoneGap_280] Warning: 
org.apache.cordova.ExposedJsApi: can't find referenced class 
android.webkit.JavascriptInterface
[2013-06-11 16:19:23 - HelloPhoneGap_280] Warning: 
org.apache.cordova.ExposedJsApi: can't find referenced class 
android.webkit.JavascriptInterface
[2013-06-11 16:19:23 - HelloPhoneGap_280] Warning: 
org.apache.cordova.ExposedJsApi: can't find referenced class 
android.webkit.JavascriptInterface
[2013-06-11 16:19:23 - 

I found this 
advice,
 
which says to add the directives

-keep public class * extends com.phonegap.api.Plugin 
-keep public class org.apache.cordova.DroidGap 
-keep public class org.apache.cordova.** 
-libraryjars /PathToYourCommensCodecJar/commons-codec.jar
-dontwarn android.webkit.*

Doing this does allow the build to complete, but I think the only line that 
does anything is the last one saying to ignore warnings. (If I take that 
line out, everything is as before.) And the resulting .apk, built with 
ProGuard warnings suppressed, does not work, as I said above.

Does anyone here know enough about ProGuard to help me make some progress? 
As a start, can someone explain why adding the directive

-keep public class android.webkit.**

has no effect on the warnings? By my understanding of ProGuard syntax, it 
should fix them all.

Any ideas appreciated at this point.
Andrew


Here are links to my posts on the phonegap forum, which may provide 
additional information.

https://groups.google.com/forum/#!topic/phonegap/JF4N4dHoAoI
https://groups.google.com/forum/#!topic/phonegap/R36T9D7B4ps

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




[android-developers] Tablet recomendation

2013-06-11 Thread BaxterCodeworks
I'm researching the possibility of developing an app for Android.  This
would be a specialty app, probably side-loaded and not sold though any
store/marketplace.

I'm looking at purchasing -cheap- hardware at this time - perhaps stepping
up to better hardware later if things prove out.  One unit I'm looking at is
the Lenovo Ideatab A2107 at about $125.  Anybody have any comments or better
ideas?

TIA




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




[android-developers] How can I upload translated descriptions of an android app to the developer console?

2013-06-11 Thread Mathieu


I have made an Android App and translated the description (which appears on 
the Play Store) of the app in many languages.

How can I upload the descriptions directly to the developer console ?

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.




[android-developers] how to get a list of locales supported by device we're running on

2013-06-11 Thread Latimerius
I understand this is a FAQ but after googling for hours and finding nothing
but forum questions with no answers and a heap of bad (non-functional)
advice, I figured I'd ask.

I'd like to allow our users to set a locale independent of the system-wide
one.  To construct the menu of available languages, I figured I'd take a
list of languages supported by the app and remove the ones not supported by
the particular device.  I wouldn't want to offer a language to the user if
the device cannot render texts in that language (say due to a missing font
or code support).

Getting a list of languages device can render turned out surprisingly hard
though.  Following hints from docs and advice from the net, I tried

Locale.getAvailableLocales()
Resources.getSystem().getAssets().getLocales() (or
just getAssets().getLocales() with same result)

none of which gets the expected result (which is something resembling the
language list in system "Language & Input" settings).  Also, there is a
mention in the docs that subsystems affected by locale settings usually
offer their own means of getting a list of supported locales which we
should use in preference to Locale.getAvailableLocales().  Fair enough but
I can see no such functions in TextView or Paint which are the subsystems I
use to draw text.

We can do without app-specific locale settings although they'd be nice to
have.  However, if just out of curiosity, I'm still wondering if it's
really not possible on Android to get this seemingly fundamental piece of
information?

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




[android-developers] Filtering listview items with SearchView in ActionBar - bad practice?

2013-06-11 Thread Miha
Hi!

I'd like to get an opinion, whether filtering a listview with a SearchView 
inside ActionBar is a bad practice or not?

I've already implemented it, and now I see all of the issues I have to deal 
with manually, in order to get a consistent experience. Problems are more 
visible when using a "two-pane" layout, with listview on the left and 
details view on the right (like Gmail app on a tablet).

The problems I've encountered:

1) The LinearLayout I'm using for list item is a special type, which 
supports "checked" property, so I can use a backwards-compatible background 
(drawable selector) to indicate the "selected" state (which item in a list 
view is currently selected, and for which item the details (in the right 
fragment) are shown. The problem is, that when filtering the listview 
(using the adapter.getFilter().filter(query)), the items get filtered, but 
the views are not being redrawn, meaning that the selected row stays in a 
selected state, although the underlying data changes.

I didn't find an event that gets fired for such changes yet, but I'm sure 
there is something I can find to fix it.

2) I would need to "erase" the detail view (fragment) when nothing is 
selected - for search input


I looked at "stock" applications - how do they deal with it. Interestingly 
enough:

a) gmail app starts a new activity when performing search
b) play store starts a new activity when performing search
c) calendar app starts a new activity when performing search
d) stock email app starts a new activity when performing search

whereas

e) contacts (People) app, filters the list inline, the way I've 
implemented, only they handle selections correctly.


What do you guys (and gals) think? Does real-time filtering make sense, 
provided that the data is already in the memory (which is my case)? And to 
submit the "filter query" to a separate activity when the searching 
(filtering) process is a lenghty one and possibly includes network I/O?

Regards,
 Miha.

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




[android-developers] Re: Simulate an incoming call from a test?

2013-06-11 Thread amro alfares
Hello again 
please check this : 
http://developer.android.com/tools/help/monkeyrunner_concepts.html

Hope that helps 
Regards 

On Tuesday, June 4, 2013 1:20:44 AM UTC+3, Larry Meadors wrote:
>
> I have a service that reacts to incoming calls that I'm trying to test. 
>
> Is there a way to simulate an incoming call from an instrumentation test? 
>
> Larry 
>

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




[android-developers] Re: Using the "Fuse" location provider, and testing with "Fake GPS"

2013-06-11 Thread BoD
Just as a follow up, I tried the app in real conditions (going outside and 
moving), and it does work correctly.
I still don't know why it doesn't work with Fake GPS, but oh well...

-- 
BoD

On Monday, June 10, 2013 5:47:35 PM UTC+2, BoD wrote:
>
> Hi!
>
> I am trying to test my app that uses the "Fuse" location provider (from 
> Google Play Services), without having to be actually moving ;)
> In order to do so, I'm using the app "Fake GPS" (
> https://play.google.com/store/apps/details?id=com.lexa.fakegps).
> In the settings of this app, I checked Simulate moving, with an interval 
> of 5000ms and a distance of 500 meters.
>
> I can see the app works, since I see myself moving in the official Google 
> Maps app.
>
> In the system settings, in Location access, I checked 'GPS satellites', 
> and unchecked 'Wi-Fi / mobile network'.
>
> Now here is the code I use in my app:
>
> LocationRequest locationRequest = LocationRequest.create();
> 
> locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);
> locationRequest.setInterval(60 * 1000);
> locationRequest.setFastestInterval(30 * 1000);
> locationRequest.setSmallestDisplacement(50);
>
> mLocationClient.requestLocationUpdates(locationRequest, 
> getLocationUpdatesPendingIntent());
>
>
> My problem is, even though the Fake GPS app is "moving", my service is 
> called only once.  I don't receive any subsequent location changes.
> I was expected to be notified about once or twice every minute.
>
> What could be the problem?
>
> Thanks for your help,
>
> -- 
> BoD
>

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




[android-developers] Google Api Route

2013-06-11 Thread Carlos Calvo


One question for google api route


I wanted to know if it is possible to make a request to the google just getting 
the timing and duration of the full path without receiving each of the 
intermediate steps


thanks


http://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&sensor=false


 "routes" : [
  {
 "bounds" : {
"northeast" : {
   "lat" : 45.51014580,
   "lng" : -73.5525248999
},
"southwest" : {
   "lat" : 43.65331030,
   "lng" : -79.3837331999
}
 },
 "copyrights" : "Datos de mapa ©2013 Google",
 "legs" : [
{
   "distance" : {
  "text" : "542 km",
  "value" : 542385
   },
   "duration" : {
  "text" : "5h 14 min",
  "value" : 18834
   },
   "end_address" : "Montreal, Quebec, Canadá",
   "end_location" : {
  "lat" : 45.50857120,
  "lng" : -73.55376740
   },
   "start_address" : "Toronto, Ontario, Canadá",
   "start_location" : {
  "lat" : 43.65331030,
  "lng" : -79.38276750
   },

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