[android-developers] Digest for android-developers@googlegroups.com - 20 updates in 17 topics

Comments: (0)
Elijah Smith <elijah.matthew.smith@gmail.com>: Feb 29 05:19PM -0800

I'm trying to set an imageview totally programatically. This is all I am
doing:
 
ImageView d1 = new ImageView(getApplicationContext());
d1.setImageResource(R.drawable.diamond);
d1.setPadding(50, 50, 0, 0);
d1.setPadding(100, 50, 0, 0);
d1.setVisibility(View.VISIBLE);
 
 
But the image doesn't seem to be appearing on the activity. Also note that
it is not defined in the xml file. I believe that to be the problem, but I
wanted to ask if that was actually neccessary. If not, then what IS my
problem?
sardar khan <sardar.khan299@gmail.com>: Mar 01 10:21AM +0500

so you add this imageview to the parent view.Like if you have linear
layout.So linearLayout.addview(d1);
 
On Tue, Mar 1, 2016 at 6:19 AM, Elijah Smith <elijah.matthew.smith@gmail.com
developer <prubasdeingenieria@gmail.com>: Feb 29 05:26PM -0800

I want to develop an app to acquire images like google traductor module, i
seek control on the flashlight and focus furthermore memory storage. thanks
greg.bacchus@coretex.com: Feb 29 03:20PM -0800

Hi,
 
I am having a problem where my app creates and account using the account
manager and this account gets removed if the device is booted into safe
mode. The account does not re-appear when the device is booted again in
standard mode.
 
Is there any way to make my account so that it is not removed when the
device is booted in safe mode?
 
Thanks
gjs <garyjamessilva@gmail.com>: Feb 28 11:40PM -0800

Hi,
 
Not sure if this helps you much, but I too have a Sony Smart Watch 3 and
can confirm that it does indeed work ok with Bluetooth devices including
Bluetooth Low Energy devices. I just tested my Sony Smart Watch 3 working
ok with a TI Sensor tag B/LE device, eg reading the barometer sensor -
 
02-29 18:09:56.856 1737-1787/? D/BluetoothLEConnection: CALIBRATED
BAROMETER = 1020.5832253894113
 
Source code for this is located here - http://git.ti.com/sensortag-android
 
Sorry can't help you with Beacons, maybe try these -
 
https://developers.google.com/beacons/
 
https://www.pubnub.com/blog/2015-04-14-building-android-beacon-android-ibeacon-tutorial-overview/
 
Regards
 
On Monday, February 29, 2016 at 8:40:52 AM UTC+11, Buğra Öztürk wrote:
mike digioia <mpd395@gmail.com>: Feb 29 02:09PM -0800

submit me
 
mike digioia <mpd395@gmail.com>: Feb 29 01:54PM -0800

submit me
 
On Sat, Feb 27, 2016 at 3:10 AM, Ksa Placement <ksaplacementindia@gmail.com>
wrote:
 
lselwd <webmaster@poliscarhire.com>: Feb 29 09:31AM -0800

well?
 
On Sunday, February 28, 2016 at 3:20:14 PM UTC+2, Leonidas Savvides wrote:
Yaroslav Pronin <yaroslav.pronin1@gmail.com>: Feb 29 07:29AM -0800

Hello. I'm writing fully Free and Open source torrent client for Android.
Came the question choose which lib: frostwire-jlibtorrent (
https://github.com/frostwire/frostwire-jlibtorrent) or ttorrent (
https://github.com/mpetazzoni/ttorrent). I would like to hear all the
"pros" and "cons".
Megha Agarwal <megharecruiter910@gmail.com>: Feb 29 10:06AM -0500

*Hello,Please let me know if you have any consultant available for the
below role,*
 
Position : Mobile Developer
Location : Midtown West. NY
Duration : 6+ Months Contract
 
Immedite Interview
 
Need Local or near by USC,GC, EAD GC Only
 
*Sr level Hybrid App role using Phonegap/Cordova.*
 
Here is general description of the tech skills needed for this project:
 
Senior Mobile App developer who has strong experience developing
production-released PhoneGap/Cordova apps for Android and iOS. Must have
working experience developing in PhoneGap/Cordova with Backbone that is
production-ready and/or published to App Store/Google Play.
 
Strong skills in Backbone.js, Javascript/JQuery optimized for mobile
execution, REST/AJAX, Socket.IO/WebSockets, SVG, HTML and CSS.
Experienced in internationalizing and localizing apps for
multi-lingual/global support,
Experienced and follow best practices integrating PhoneGap/Corodova
plugins, as well as proficiency in developing custom plugins.
Preferable to have experience with Urban Airship API.
Skilled with Photoshop a plus.
 
__________________________________________________________________________________
 
*Please send your resumes to Steven.smith@panzersolutions.com
<Steven.smith@panzersolutions.com> for immediate consideration*
 
 
* Thanks,Steven Smith Steven.smith@panzersolutions.com
<Steven.smith@panzersolutions.com>*
Rodrigo Saad <digaots@gmail.com>: Feb 29 06:39AM -0800

Hello,
 
We are experiencing problems with GPS in almost all smartphones (Nexus,
Mogo-G 2nd, Moto-G 3nd, Moto-X) with Android 6 (Marshmallow). In our case,
it does not acquire a good accuracy and, consequently, it does not return
the speed anymore (location.getSpeed). There is an open ticket but without
any update from google since last December
(https://code.google.com/p/android/issues/detail?id=190376).
 
Anyone else having the same problem? Any advice to solve it, at least
temporarily?
 
Cheers,
 
Rodrigo Saad
sam isolvers <samisolvers1@gmail.com>: Feb 29 09:24AM -0500

Hello Partner,
 
Good morning, Hope you are doing good,
 
Please find below updated Hot-List of my consultants ,Let me know if you
came across any matched positions according to them.
 
I look forward to work with you.
 
 
 
SNO
 
Name
 
Skill
 
Experience
 
Location
 
Relocation
 
1
 
Naveen
 
CQ5
 
7+
 
NY
 
Open
 
2
 
Harsha
 
CQ5
 
7+
 
NJ
 
Open
 
3
 
Janani
 
SQL BI
 
7+
 
NY
 
Open
 
4
 
Phani
 
SQL BI
 
8+
 
RI
 
Open
 
5
 
Usha
 
QA
 
7+
 
WA
 
Open
 
6
 
Pradeep
 
IOS
 
7+
 
AZ
 
Open
 
7
 
Pratisha
 
BA
 
7+
 
IL
 
Open
 
8
 
Ravi
 
QA Lead
 
14+
 
UT
 
Open
 
9
 
Rakul
 
UI
 
10+
 
MO
 
Open
 
10
 
Sriharsha
 
Oracle DBA
 
10+
 
FL
 
Open
 
11
 
Amulya
 
OBIEE
 
8+
 
CA
 
Bay Area
 
12
 
Brahmi
 
Pega
 
6
 
MD
 
Open
 
13
 
Veera
 
Pega
 
8
 
TX
 
Open
 
14
 
Nishita
 
Pega
 
6+
 
CT
 
Open
 
15
 
Sridhar
 
Pega
 
14+
 
NE
 
Open
 
16
 
Prathyusha
 
.Net
 
7
 
WA
 
Open
 
17
 
Lakshmi
 
.Net
 
7+
 
PA
 
Open
 
18
 
Swathi
 
Java
 
6
 
IL
 
Open
 
19
 
Aditya
 
Java
 
7+
 
FL
 
Open
 
 
Sam
Isolvers Inc
727-565-1237
sam@isolvers.com
Jeevan Quad <jeevan.quad@gmail.com>: Feb 29 04:28AM -0800

Hi Sir,
 
I am new to android. i need to store the multiple images to store into
sqlite db and display on listview. If any one having code share to me......
Pankaj Deshpande <pcdeshpande101@gmail.com>: Feb 29 06:07PM +0530

Just curious question...why do you want to store images in DB? Instead, you
can store the image on SD card and just store the path of image in DB.
When you want to show the image, just pickup the image from path and
display. If accidentally the image got deleted, then display any default
image.
Adrees 85 <adrees85@gmail.com>: Feb 29 04:20AM -0800

Hello Guys ,
i'm working on android app development from 6 month. i heard about android
wear development and its look interesting to me. i want to know should i go
for android wear development ?
any recommendation ?
manny thanks
Marimuthu C <muthucwc.seopro@gmail.com>: Feb 29 03:37AM -0800

Dear App Developer,
 
Since we are conducting a research work on "improving the energy efficiency
of Mobile applications", we need to know the preliminary information from
App Developers. It is our sincere request to you to share your experience
and opinion on energy efficiency, energy saving techniques of mobile
applications.
 
This Anonymous survey is completely for education purpose, and will take
approximately 5 minutes. None of your company or personal information will
be asked. Your experience and opinion is highly appreciated.
 
Survey Link: http://goo.gl/forms/I9nTKqQWam
 
Kindly do share this survey form with your colleagues.
 
Thanks and Regards,
Marimuthu C,
Research Scholar,
Department of computer Science and Engineering,
National Institute of Technology Karnataka, Surathkal,
Mangalore, India.
John Smith <johnsmithgt55@gmail.com>: Feb 29 02:25AM -0800

Hello guys
i have developed 2 android apps which is uploaded in play store and i need
to increase app download which way can i choose and what can i do for this??
"mu.huber" <mu.huber@gmail.com>: Feb 29 10:54AM +0100

Phonegap does the trick with the apk for me and also automaticly include
the manifest. So i cannot see that file without reverse engeneering (dont
know how). But when i read the phonegap documentation i looks like the
manifest is optimized for all screens.
Andrey Kuptsov <andrey.kuptsov.k@gmail.com>: Feb 29 01:30AM -0800

Hello there!
I can't download Android Studio. The download is interrupted at the last
100 Mb.
Thanks!
Jacky Lam <jackylam.spectratech@gmail.com>: Feb 29 01:24AM -0800

Does anyone can save me?
 
On Monday, February 15, 2016 at 3:04:29 PM UTC+8, Jacky Lam wrote:
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 17 updates in 10 topics

Comments: (0)
mu.huber@gmail.com: Feb 28 10:13AM -0800

Hey Community
 
I have made an app for Android, but the Play Store doesnt think its Tablet
optimized. Its full responsive and looks good on all devices (Tablet/Phone)
i have tested. I have not used breakpoints. I have tried to use diffrent
android-minSdkVersion but that doesnt help. Do you guys have an idea whats
wrong?
 
 
 
 
<https://lh3.googleusercontent.com/-x5slxv0tgQw/VtM4qX9ny6I/AAAAAAAAAOU/wzvdbsTgdS4/s1600/config.png>
 
<https://lh3.googleusercontent.com/-JpgH0Al1J38/VtM4tB5RspI/AAAAAAAAAOY/QP7NvI664aY/s1600/PlayStore.png>
 
 
<https://lh3.googleusercontent.com/-3hOevy7pm38/VtM4gjlV_FI/AAAAAAAAAOQ/SNw_WvTHxkA/s1600/Bildschirmfoto%2B2016-02-28%2Bum%2B18.53.18.png>
Steve Gabrilowitz <steveg1701@gmail.com>: Feb 28 02:55PM -0500

Did you upload tablet screen shots to the Play Store description?
mu.huber@gmail.com: Feb 28 12:34PM -0800

I do not have made real screenshots of an 7" and an 10" tablet. I just
uploaded the same screenshot for both.
 
mu.huber@gmail.com: Feb 28 12:32PM -0800

Yes i have two screenshots there (minimum) Do you think that causes the
problem and not the config.xml?
 
Am Sonntag, 28. Februar 2016 21:07:04 UTC+1 schrieb Steve Gabrilowitz:
 
Did you upload tablet screen shots to the Play Store description?
Kostya Vasilyev <kmansoft@gmail.com>: Feb 29 12:23AM +0300

I think they have some sort of logic (behind the publishing console) to
detect if your tablet screenshots are sufficiently different from phone
screenshots.
 
I once contacted Play support about it -- and they wrote back that my app
doesn't look sufficiently different on tablets, so will not get the
"optimized for tablets" in its listing.
 
They wanted whole different layouts, not just bigger fonts or wider padding.
 
So there is human moderation too, it seems.
 
-- K
 
"mu.huber" <mu.huber@gmail.com>: Feb 28 10:37PM +0100

Actually i hope this is not causing the problem because its a simple game
for cats. It makes no sense to have a diffrent layout.
 
I have zero experience in making apps but i think the problem is somewhere
else, even if the apk (i have generated from mt html5/javascript/css
folder) works perfectly fine, installed directly on doffrent devices.
 
I have no other tests running on that apk other than on real devices.
Steve Gabrilowitz <steveg1701@gmail.com>: Feb 28 06:27PM -0500


> Yes i have two screenshots there (minimum) Do you think that causes the
problem and not the config.xml?
 
Several things can cause that issue, including not having the proper screen
shots. Maybe try posting your manifest file?
 
 
>> On Feb 28, 2016 1:14 PM, <mu.h...@gmail.com> wrote:
 
>>> Hey Community
 
>>> I have made an app for Android, but the Play Store doesnt think its
Tablet optimized. Its full responsive and looks good on all devices
(Tablet/Phone) i have tested. I have not used breakpoints. I have tried to
use diffrent android-minSdkVersion but that doesnt help. Do you guys have
an idea whats wrong?
 
>>> --
>>> 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+unsubscribe@googlegroups.com.
>>> To post to this group, send email to android-d...@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/7857f475-2506-445b-8ee9-f0c57f3383e9%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+unsubscribe@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/88955200-661b-440f-897a-6484bc37d683%40googlegroups.com
.
"Buğra Öztürk" <ozturkbugra93@gmail.com>: Feb 28 01:40PM -0800

Me and my friends try to make a Android Wear app that will communicate with
Beacons. We have to provide bluetooth connection between our wear and
beacon in our program. But we have not found any information about Android
wear bluetooth connection code example or something else. If there is a any
informations you knew, pls tell me and rescue me this struggle. Our wear is
Sony Smart Watch 3 by the way. Thank you for now.
"Dino Velić" <meme.applications@gmail.com>: Feb 28 11:00AM -0800

Hello,
 
I've published my game for children on 11th of February.
 
I've flagged my AdMob in code with tagForChildDirectedTreatment, but users
are still seeing other inappropriate ads, like dating ads.
 
I can't find any contact info of Admob. Is there anything I can do?
 
I'm a bit embarassed by this problem, because I wouldn't want my child to
see anything inappropriate, let alone somebody else's child.
 
Dino
"Dino Velić" <meme.applications@gmail.com>: Feb 28 10:59AM -0800

Hello,
 
I've published my game for children on 11th of February.
 
I've flagged my AdMob in code with tagForChildDirectedTreatment, but users
are still seeing other inappropriate ads, like dating ads.
 
I can't find any contact info of Admob. Is there anything I can do?
 
I'm a bit embarassed by this problem, because I wouldn't want my child to
see anything inappropriate, let alone somebody else's child.
 
Dino
Ignacio O <ignacio030866@gmail.com>: Feb 28 09:55AM -0800

I update windows 8 to windows 10 an my IDE now have a diferente languaje in
menus, idont now how change, add an image.
 
 
<https://lh3.googleusercontent.com/-7UfIdHn9fUs/VtM0hw0G6wI/AAAAAAAAB5c/Bfr1yaugERE/s1600/ide.png>
 
 
HELP ME!!!!!
gjs <garyjamessilva@gmail.com>: Feb 27 10:36PM -0800

Hi
 
Try https://cloud.google.com/solutions/mobile/appengine-endpoints-mobile-app
 
Regards
"Cowboy1Brian ." <brian.kjames75@gmail.com>: Feb 28 10:55AM -0600

Thank you Gary. I look forward to diving into this.
 
Leonidas Savvides <developer.lse@gmail.com>: Feb 28 05:20AM -0800

A Used Car Company that handles many brands of cars asked my Mobile
Development Office to develop for them,... 10 top brand cars Apps, one App
per car brand...
 
About usage of Car brand logos eg BMW Logo
 
I can go to company car brand Logo (Press) section - find a logo and put in
Home Page... this with stating clearly in App title and H1 titles that App
is About BMW Used Cars...?
 
This I cannot do is find a logo from Google Images even logo states only
the brand - and is the same as above... logo from Press office of brand?
 
*these are correct 1st-can , 2nd-cannot...???*
Zakaria Zouitni <zakariaa.zouitni@gmail.com>: Feb 28 05:02AM -0800

Thnks you so much Shane Carr, thats look greet (y)
 
 
Ken Tavin <shiftykevapps@gmail.com>: Feb 28 04:58AM -0800

Hello fellow developers!
 
 
I am trying to integrate Admob interstitials/pop ups into a Corona SDK
game. Does anyone know how to scroll or animate the adMob interstitial
itself. For instance, when the adMob interstitial is called, rather than
popping up directly onto the
phone screen, it slides in/scrolls in from the bottom and then up to fill
the entire screen? I've tried searching through online for any official
documentation but have had no luck.
 
Any help would be much appreciated.
 
Thanks aplenty
 
Ken
"Ezequiel R. Zorzal" <ezorzal@gmail.com>: Feb 28 04:25AM -0800

I'm trying to implement the GCM service in my application, but I'm having
trouble sending the TOKEN to my server.
Please help me with this problem. Even in my class does not print logs in
my logcat. However, when I run the app it generates the following:
 
 
02-26 11:32:29.684 11399-11537/mycompany I/b: Sending API token request.
02-26 11:32:30.025 11399-11537/mycompany I/b: Received API Token:
AH0uPGGC ... zZfMp / Expires in: 432000000ms
02-26 11:32:30.034 11399-11537/mycompany I/g: Saved auth token
 
 
I want to take this token and send it to my server.
Thank you!
See my code below:
 
*AndroidManifest.xml*
 
...

<!-- [START gcm_permission] -->
<uses-permission android:name=
"com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- [END gcm_permission] -->

<permission
android:name="mycompany.permission.C2D_MESSAGE"
android:protectionLevel="signature" />

<uses-permission android:name="mycompany.permission.C2D_MESSAGE" />

...

<!-- [START gcm_listener] -->
<service
android:name="mycompany.GCM.MyGcmListenerService"
android:exported="false" >
<intent-filter>
<action android:name=
"com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!-- [END gcm_listener] -->
<!-- [START instanceId_listener] -->
<service
android:name="mycompany.GCM.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name=
"com.google.android.gms.iid.InstanceID"/>
</intent-filter>
</service>
<!-- [END instanceId_listener] -->
<service
android:name="mycompany.GCM.RegistrationIntentService"
android:exported="false">


</service>
...
 
 
*MyGcmListenerService.java*
 
...

public class MyGcmListenerService extends GcmListenerService {

private static final String TAG = "MyGcmListenerService";


/**
* Called when message is received.
*
*
* @param from SenderID of the sender.
* @param data Data bundle containing message data as key/value
pairs.
* For Set of keys use data.keySet().
*/
// [START receive_message]
@Override
public void onMessageReceived(String from, Bundle data) {
String message = data.getString("message");
Log.d(TAG, "From: " + from);
Log.d(TAG, "Message: " + message);

if (from.startsWith("/topics/")) {
// message received from some topic.
} else {
// normal downstream message.
}

// [START_EXCLUDE]
/**
* Production applications would usually process the message
here.
* Eg: - Syncing with server.
* - Store message in local database.
* - Update UI.
*/

/**
* In some cases it may be useful to show a notification
indicating to the user
* that a message was received.
*/
sendNotification(message);
// [END_EXCLUDE]
}
// [END receive_message]

/**
* Create and show a simple notification containing the received
GCM message.
*
* @param message GCM message received.
*/
private void sendNotification(String message) {
Intent intent = new Intent(this, MapActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /*
Request code */, intent,
PendingIntent.FLAG_ONE_SHOT);

Bitmap bm = BitmapFactory.decodeResource(getResources(), R.
drawable.icone);

Uri defaultSoundUri = RingtoneManager.getDefaultUri(
RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder notificationBuilder = new
NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.icone2)
.setLargeIcon(bm)
.setContentTitle("Title")
.setContentText(message)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent);

NotificationManager notificationManager =
(NotificationManager) getSystemService(Context.
NOTIFICATION_SERVICE);

notificationManager.notify(0 /* ID of notification */,
notificationBuilder.build());
}
}
 
 
 
 
*MyInstanceIDListenerService.java*
 
 
 
public class MyInstanceIDListenerService extends
InstanceIDListenerService {

private static final String TAG = "MyInstanceIDLS";

/**
* Called if InstanceID token is updated. This may occur if the
security of
* the previous token had been compromised. This call is initiated
by the
* InstanceID provider.
*/
// [START refresh_token]
@Override
public void onTokenRefresh() {
// Fetch updated Instance ID token and notify our app's server
of any changes (if applicable).
Intent intent = new Intent(this, RegistrationIntentService.class
);
startService(intent);
}
// [END refresh_token]
}
 
 
*QuickstartPreferences.java*
 
 
public class QuickstartPreferences {

public static final String SENT_TOKEN_TO_SERVER =
"sentTokenToServer";
public static final String REGISTRATION_COMPLETE =
"registrationComplete";

}
 
 
*RegistrationIntentService.java*
 
 
public class RegistrationIntentService extends IntentService {

private static final String TAG = "RegIntentService";
private static final String[] TOPICS = {"global"};



public RegistrationIntentService() {
super(TAG);
}


@Override
protected void onHandleIntent(Intent intent) {
SharedPreferences sharedPreferences = PreferenceManager.
getDefaultSharedPreferences(this);

try {
// [START register_for_gcm]
// Initially this call goes out to the network to retrieve
the token, subsequent calls
// are local.
// R.string.gcm_defaultSenderId (the Sender ID) is
typically derived from google-services.json.
// See
https://developers.google.com/cloud-messaging/android/start for details on
this file.
// [START get_token]
String authorizedEntity = "XXXXXXXX"; // Project id from
Google Developers Console
String scope = "GCM"; // e.g. communicating using GCM, but
you can use any


//InstanceID instanceID = InstanceID.getInstance(this);
String token = InstanceID.getInstance(this).getToken(
authorizedEntity,scope);
// String token = instanceID.getToken(authorizedEntity,
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
//send token to app server

Log.d(TAG, "GCM Registration Token: " + token); //NOT PRINT


// TODO: Implement this method to send any registration to
your app's servers.
sendRegistrationToServer(token);

// Subscribe to topic channels
subscribeTopics(token);

// You should store a boolean that indicates whether the
generated token has been
// sent to your server. If the boolean is false, send the
token to your server,
// otherwise your server should have already received the
token.
sharedPreferences.edit().putBoolean(QuickstartPreferences.
SENT_TOKEN_TO_SERVER, true).apply();
// [END register_for_gcm]
} catch (Exception e) {
Log.d(TAG, "Failed to complete token refresh", e);
// If an exception happens while fetching the new token or
updating our registration data
// on a third-party server, this ensures that we'll attempt
the update at a later time.
sharedPreferences.edit().putBoolean(QuickstartPreferences.
SENT_TOKEN_TO_SERVER, false).apply();
}
// Notify UI that registration has completed, so the progress
indicator can be hidden.

Intent registrationComplete = new Intent(QuickstartPreferences.
REGISTRATION_COMPLETE);
LocalBroadcastManager.getInstance(this).sendBroadcast(
registrationComplete);
}



/**
* Persist registration to third-party servers.
*
* Modify this method to associate the user's GCM registration
token with any server-side account
* maintained by your application.
*
* @param token The new token.
*/
private void sendRegistrationToServer(String token) {
// Add custom implementation, as needed.
//Enviar para servidor
Log.e("TOKEN:", token); //NOT PRINT

HttpURLConnection connection;
OutputStreamWriter request = null;

URL url = null;
String response = null;

String param = "dtoken="+token+"&dtype=Android";
try {
url = new URL("http://myurl.com/action.php");
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
connection.setRequestMethod("POST");

request = new OutputStreamWriter(connection.getOutputStream
());
request.write(param);
request.flush();
request.close();
String line = "";
InputStreamReader isr = new InputStreamReader(connection.
getInputStream());
BufferedReader reader = new BufferedReader(isr);
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
isr.close();
reader.close();

} catch (IOException e) {
// Error
}


}


/**
* Subscribe to any GCM topics of interest, as defined by the
TOPICS constant.
*
* @param token GCM token
* @throws IOException if unable to reach the GCM PubSub service
*/
// [START subscribe_topics]
private void subscribeTopics(String token) throws IOException {
GcmPubSub pubSub = GcmPubSub.getInstance(this);
for (String topic : TOPICS) {
pubSub.subscribe(token, "/topics/" + topic, null);
}
}
// [END subscribe_topics]

}
 
 
 
 
 
Thanks for helping me!
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.

[android-developers] Digest for android-developers@googlegroups.com - 15 updates in 13 topics

Comments: (0)
yeo yong Lau <yong931009@gmail.com>: Feb 27 09:16PM -0800

On Friday, February 26, 2016 at 3:19:55 AM UTC+8, TreKing wrote:
 
> -------------------------------------------------------------------------------------------------
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices
 
hi trekking,
 
i am using hybrid development not native. is using javascript and cordova
for android application development.
do you know how to increase the badge count on the app icon? and use
cordova build android application development before?
Jinni95 <jinni_ng@hotmail.com>: Feb 27 08:31PM -0800

Yes I did. Only if I go into full screen or presentation mode does the
window appear. But it should also appear even when not in full screen mode
as it did when I initially installed it. Sometimes it loads properly
sometimes it doesn't.
 
On Friday, February 26, 2016 at 2:42:02 AM UTC+8, TreKing wrote:
Neville Mogent Jr <nmogent123@gmail.com>: Feb 27 05:11PM -0800

Hello,
 
I am trying to use the built in camera for android phones and I am using
code from the android studio website on "Taking Photos
Simply" http://developer.android.com/training/camera/photobasics.html.
 
However mImageView does not work. It says it cannot resolve the symbol
mImageView. I tried using ImageView because the Android Studio recognizes
this. But the line ImageView.setImageBitmap(imageBitmap); (Originally with
mImageView) does not work it says non-static method setImageBitmap(
imageBitmap) cannot be referenced from static method.
 
How can I resolve this? Any help or ideas about what this mImageView is
will be appreciated.
Cowboy1Brian <brian.kjames75@gmail.com>: Feb 27 03:58PM -0800

I am new to Android Dev. I want to create a client server style app that
has the following features:
 
*App 1*
 
- Activity is google map with markers
- Markers represent gps positions from remote devices(app2) broadcasted
location
- Markers will only show up in App1 user's map if within certain radius
of App2 device broadcasted location (geofencing??)
 
*App 2*
 
- activity broadcasts gps position
- user can input data to be displayed on map marker that will display
for user on app1
 
 
I guess this would be sort of like an uber style app, where the app1 person
can see the App2 user as it moves around locally within, say a 10 mile
radius. I just need to know what would be the best way to achieve this. Any
help would be greatly appreciated.
 
-Brian
Zakaria Zouitni <zakariaa.zouitni@gmail.com>: Feb 27 02:34PM -0800

pls the best tutos to beggain in Application Mobile (Android) ?!
Shane Carr <shanepcarr@gmail.com>: Feb 27 02:56PM -0800


> I liked the big nerd ranch book on amazon.
 
I liked this to get started, very organized.
http://developer.android.com/training/index.html
 
I also used a lot of youtube and pluralsight.
Adrian Ivasku <ivasku.adrian@gmail.com>: Feb 27 10:38AM -0800

Hello,
 
I am trying to make a news app that would read news from a particular web
page... I have done this with Jsoup library but it is very slow... on a
fast phone with good internet connection it takes for 3-6 seconds to load a
page... and I have optimized the code that gets the Document object from a
page...
 
I have read today about volley library, which is apparently ultra fast and
ideal for this kind of tasks... I have been reading and looking at volley
examples... but I fail to see the point... Could anyone explain some more,
with example situation why should I use volley?
 
Can anyone give me advice in which direction should I go to make this news
app, should I use volley ? or even if possible volley with jsoup.... in
general. What libraries should I use?
Shane Carr <shanepcarr@gmail.com>: Feb 27 02:24PM -0800

I have only written one large android application. In my experience volley
was outstanding. http://developer.android.com/training/volley/index.html. I
grabbed that from teh first web search. It lists some of the benefits, it
is extremely advanced. You can find a ton of examples on github. I am not
familiar with the library you are talking about, so it is hard for me to
compare it. Generally volley and android in general does a great job of
forcing you to do things in the background so you aren't blocking the ui.
There are a number of factors to take in consideration too. The protocal
ideally is pretty light weight like json since you are pulling from a phone
with a spotty connection, and you want light weight deserialization. One of
the elements of my project was a giphy selection control. very media
intensive. Being smart about how you load data (not loading too much) and
getting a few in so the user sees something while the rest is loading
helps. Also there are a lot of libraries that work with the network that
can help such as media libraries if you are pulling rich media and you need
some compression and caching. Volley has caching and queuing mechanisms
which probably the other library you are using don't have. Look at git hub
for Volley examples there are tons and tons. I bet it would be pretty easy
to bench mark wtih what you are doing and to a quick comparsion.
 
On Saturday, February 27, 2016 at 10:38:09 AM UTC-8, Adrian Ivasku wrote:
Shane Carr <shanepcarr@gmail.com>: Feb 27 02:15PM -0800

Hello, I currently work on a social messaging product we build for Android.
I want to migrated it to a multi platform desktop application in chrome.
 
We have an Android version which works and is live in google play, and has
been very successful. My scenario is I'd like to light this up cross all
major oses clearly we'll need to make some modifications. The scenario:to
run on Linux ( eg Mint), chrome os, Mac, Windows. I am looking for advice
about approaches. Some time last year i prototyped the app on arc-weld and
it ran fine, minus no gcm, and i'll need a sinal r library. From some
casual investigation it isn't clear to me if this is intended for
production usage. Whatever i build needs to be be distributed officially
the chrome store or some official store. I work for a very large company
and we like to light this up at a large scale. It wont' be a toy project.
The other alternative i am aware of is a chrome extensions. Looking at this
it seems like a more significant rewrite from where we are. In addition the
architecture doesn't seem as advanced as the android architecture, which i
find incredibly elegant. Also we use a sqlite database so it seems i'd
probably have to look at some alternatives there as well like indexdb or
something. My question is can anyone suggest some points to get started.
However we have a lot of resources, and engineering cost isn't as much of
an issue. We need a no compromise experience, beautiful and elegant. Which
of these options would google more likely recommend, and are there any
others which might be better. The only constraint on this is i'd like to
distribute it though one of the google stores, it needs to be safe and
consumable for edu/business type scenarios. We have very high standards on
experience, deployment, security etc.
Shane Carr <shanepcarr@gmail.com>: Feb 27 02:04PM -0800

Hello, I currently work on a social messaging product we build for Android.
I want to migrated it to a multiplatform desktop application in chrome. We
have an Android version which works and is live in google play, and has
been very successful. My scenario is I'd like to light this up cross
platform version. I'd like it to run on Linux ( eg Mint), chrome os, Mac,
Windows. I am looking for advice about approaches. Some time last year i
prototyped the app on arch weld and it generally ran fine, minus no gcm,
and i'll need a sinal r library. From some casual investigation it isn't
clear to me if this is intended for production usage. Whatever i build
needs to be be distributed officially the chrome store or some official
store. I work for a very large company and we like to light this up at a
large scale. It wont' be a toy project in the long term. The other
alternative i am aware of is a chrome extensions. Looking at this it seems
like a more significant rewrite from where we are. In addition the
architecture doesn't seem as advanced as the android architecture, which i
find incredibly elegant. Also we use a sqlite database so it seems i'd
probably have to look at some alternatives there as well like indexdb or
something. My question is can anyone suggest some points to get started.
However we have a lot of resources, and engineering cost isn't as much of
an issue. We need a no compromise experience, beautiful and elegant. Which
of these options would google more likely recommend, and are there any
others which might be better. The only constraint on this is i'd like to
distribute it though one of the google stores, it needs to be safe and
consumable for edu/business type scenarios. We have very high standards on
experience, deployment, security etc.
choy edmund <edmundchoyyk@gmail.com>: Feb 27 06:45AM -0800

I have basically create a interface on register,login, edit profile and logout interface using android studio but I do not know how to relates the codes for each interface using a user class and specify a admin and user role in java. The other problem I encounter is I do not know how to send data to the list view and apply the basic concept of create, retrieve, update and delete the events. Selecting only the events being created by a specific user to view others event but they can apply the basic crud concept on their own events.
Please do reply as soon as possible as I have to finish this assignment by tmr night. Thanks a lot for anyone who is willing to help out in my program as I am new in android studio.
If there is any query please contact me at edmundchoyyk@gmail.com
Tobias Baumeister <baumeistertb@gmail.com>: Feb 27 04:27AM -0800

In my custom XML files (located in res/xml), I want to use the Android
Namespace (xmlns:android="http://schemas.android.com/apk/res/android") to
be able to use attributes like android:text.
However, I also want to set my own XSD-File for validation purposes (for
myself only. So Android Studio reports errors when I make a typo or forget
about tags)
 
For some reason, whenever I add another xmlns, it says that xmlns:android
is no longer valid (URI not registered).
Is there a way to do this?
Mark van Limburg <vimenze@gmail.com>: Feb 27 04:25AM -0800

After quite some time of working on a facebook login application and
getting page-feed from a public page.
My next attempt is to get Push Notifications when a post is made on a
public page.
However after hours and days of searching, i still have no results.
 
I have noticed that i am supposed to work with a callback url so that
Facebook updates the url with their latest data.
But that does not explain to me how i can get a push notification to the
application and updates the user that a new post has been made and then
shows into the "Page Feed" activity.
 
Is there anyone who can guide me in the right direction?
Ksa Placement <ksaplacementindia@gmail.com>: Feb 27 03:10AM -0800

For JD https://goo.gl/0AfPMD
 
Regards
ksa Placement India
catafest <catalinfest@gmail.com>: Feb 27 01:37AM -0800

Dear friends.
 
I want to make one application with bluetooth and android device 4.1.2
version.
The application need to find my and take the signal strength of another
device and compare it to a set of time intervals.
Basically is a point to point check between my application phone and
another on my device with nothing else but with bluetooth enabled.
So I need some help with infos / tutorials.
I used Android Studio 2.0 Beta - last version 6.
 
Thank you. Regards.
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to android-developers+unsubscribe@googlegroups.com.