[android-developers] Re: Is runOnUiThread() ever 'safe' to call? If not why is it not deprecated?

2015-06-21 Thread 'RLScott' via Android Developers
Google is still promoting runOnUiThread in their sample Bluetooth Low 
Energy device scan callback code:

private BluetoothAdapter.LeScanCallback mLeScanCallback =
new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(final BluetoothDevice device, int rssi,
byte[] scanRecord) {
runOnUiThread(new Runnable() {
   @Override
   public void run() {
   mLeDeviceListAdapter.addDevice(device);
   mLeDeviceListAdapter.notifyDataSetChanged();
   }
   });
   }
};

-Robert Scott
Hopkins, MN



On Tuesday, June 9, 2015 at 12:39:13 PM UTC-6, Sam Duke wrote:

 Due to the nature of config changes, the runnable submitted to 
 runOnUiThread may be executed after an activity has been destroyed (i.e. on 
 a stale activity). Therefore this API can cause all sorts of subtle bugs 
 with config changes and events never reaching the UI. I can't think of a 
 single case where it would be safe to use this. You should already have hit 
 the main thread by the time you are doing anything inside the runnable... I 
 think all it does is encourage poor patterns...

 Given this, is it not time to deprecate this API?




-- 
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] Pintar mapa al vuelo

2015-06-21 Thread TreKing
Lo que muestras no indica si estas añadiendo el LinearLayout B al
Activity correctamente. Porque no lo haces en XML?

On Thu, Jun 18, 2015 at 5:49 AM, Jefferson Delgado P. jjdel...@gmail.com
wrote:

 Buenos días,

 Llevo ya un par de días peleándome e intentando mostrar un mapa de google
 al vuelo, es decir, en base a lo que me venga del servidor, tengo que
 pintar un mapa, un select o lo que toque, y con el mapa no lo he
 conseguido. He estado mirando varias opciones y la que he visto más
 factible, ha sido la siguiente:

  LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
 LayoutParams.MATCH_PARENT,
  LayoutParams.WRAP_CONTENT);
  LinearLayout B = new LinearLayout(mContext);
  B.setOrientation(LinearLayout.VERTICAL);


  GoogleMapOptions options = new GoogleMapOptions();
  options.camera(new CameraPosition(new LatLng(0, 0), 1, 0, 0));
  MapView mMapFragment = new MapView(mContext, options);
  params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, 200);
  mMapFragment.setLayoutParams(params);

  B.addView(mMapFragment);


 He probado con distintas variantes y no consigo que el mapa se vea, ni en
 gris, ni amago ni nada de nada, aunque eso si, el espacio de 200px me lo
 respeta y se ve un gran cuadro en blanco.

 Lo intenté con un SupportMapFragment en lugar de MapView pero nunca llegué
 a poder siquiera ejecutarlo.

 Si alguno me puede arrojar algo de luz, se lo agradecería.

 Muchas gracias.


 Un saludo

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




-- 

-
TreKing http://sites.google.com/site/rezmobileapps/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/d/optout.


Re: [android-developers] Hi Gays! I have a question that want to ask you about the payment from Google.

2015-06-21 Thread TreKing
On Tue, Jun 16, 2015 at 11:04 PM, 张张斌 kimichangs...@gmail.com wrote:

 I just want to know,does the payment be pushed to my Credit Card as soon
 as the transaction happens or at a regular time of a month/day?


You need a bank account and you're paid monthly.
https://support.google.com/googleplay/android-developer/answer/173779?hl=en

-
TreKing http://sites.google.com/site/rezmobileapps/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/d/optout.


Re: [android-developers] wakeup my app from bluetooth

2015-06-21 Thread TreKing
You should explain how you're going about to getting bluetooth data now
(like with code snippets). You minimal description is too vague for anyone
to really address.

On Thu, Jun 18, 2015 at 4:19 AM, Jags jag...@gmail.com wrote:

 my current application is about reading data from a bluetooth device. when
 my application is in background, my application wakes up and receives data
 properly. But when the application is stopped by me from list of background
 apps, or the app has not run at all, the application does not wake up.

 Request experts to guide me to a solution approach. I want my application
 to wake up from stopped state when bluetooth pair happens or data is pushed
 from bluetooth.

 thanks and regards
 jags

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




-- 

-
TreKing http://sites.google.com/site/rezmobileapps/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/d/optout.