[android-developers] HandlerThread the right way ?

2015-12-31 Thread Grunk
Hello,

I'm using HandlerThread like below in my app. Is it correct ?


public class MyThread extends HandlerThread implements Callback
{
public ThreadDP(Handler uiHandler)
{
super(MyThread.class.getSimpleName(), Process.
THREAD_PRIORITY_DISPLAY);
mUiHandler = uiHandler;
this.start();
}


@Override
protected void onLooperPrepared()
{
super.onLooperPrepared();
synchronized (this) {
mThreadHandler = new Handler(getLooper(),this);
notifyAll();
}
}


public LabelList getLabels()
{
//Get some datas from network
return labels;
}


@Override
public boolean handleMessage(Message msg) {


Message message;
Bundle bundle;


switch (msg.what)
{
case ThreadMessages.GET_LABELS : 


message = mUiHandler.obtainMessage();
message.what = ThreadMessages.GET_LABELS;


Bundle bu = new Bundle();
bu.putInt("myapp.idThread", mIdThread);
bu.putParcelable("myapp.label", this.getLabels());
message.setData(bu);
this.uiHandler.sendMessage(message);
return true;
}
}
}


And then : 

mThread = new MyThread(uiHandler);
mThread.start();
mThread.getHandler().sendEmptyMessage(ThreadMessages.GET_LABELS);

The communication between the thread and UI is going pretty well , but i'm 
little confused by the lack of runnable. Should is keep using this way or 
am i missing something important ? 

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/6d8a26a3-107c-44a3-a430-93b4a165ae69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Code for NFC tag to turn bluetooth-tethering on/off

2015-12-31 Thread Vijay Gurumukhi
Hi Daniel,
How to read NFC tag in android  i can give solution for that, but bt 
tethering need check, pleas let me know if u need any help.
Thanks 
Vijay Guru.

On Wednesday, 30 December 2015 21:09:41 UTC+5:30, Daniel Kußmaul wrote:
>
> Hello
>
> I want to use a NFC tag for turning bluetooth-tethering on/off on my 
> android phone. 
>
> I found no app that supports this function. There is the opportunity to 
> write an URI on the tag in order to open e.g. an application.
>
> So is there a chance to use such an URI or a 'code' that I could write on 
> the tag to turn bt-tethering on/off.
>
>
> Thanks in advance!
>
> Best regards
>
> Daniel Kußmaul
>

-- 
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/6537e6e2-7221-4071-973f-901c0aa79502%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] Intercept all HTTP Connect request from webview

2015-12-31 Thread Samiksha Saxena
i used fiddler to monitor the traffic, but I want to intercept the Connect 
method to add my custom header programmatically in android.

On Thursday, December 31, 2015 at 2:29:33 AM UTC-5, Vipin wrote:
>
> You can use fiddler tool which is used for request monitoring.
>
> Thanks!!
> On 31-Dec-2015 5:25 am, "Samiksha Saxena"  > wrote:
>
>> Hi, 
>> i have a sample app which is loading a webpage within a webview. The 
>> webpage is over HTTPS and is routed through a proxy server. As i am using a 
>> proxy server between client and the server, the browser is creating a 
>> tunnel using HTTP Connect method. I want to intercept the Connect request 
>> and insert my own headers to the request, how can i do so? Does it possible 
>> to do so?
>>
>> 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-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/94815b78-5230-4b75-b488-f174a0989e07%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/93f78615-580e-49e0-9d1d-036dbc24339d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Code for NFC tag to turn bluetooth-tethering on/off

2015-12-31 Thread Daniel Kußmaul
Hi Vijay, 

yes I need help. Would be great if you can help me.

Thanks in advance

Best regards

Am Donnerstag, 31. Dezember 2015 11:45:24 UTC+1 schrieb Vijay Gurumukhi:
>
> Hi Daniel,
> How to read NFC tag in android  i can give solution for that, but bt 
> tethering need check, pleas let me know if u need any help.
> Thanks 
> Vijay Guru.
>
> On Wednesday, 30 December 2015 21:09:41 UTC+5:30, Daniel Kußmaul wrote:
>>
>> Hello
>>
>> I want to use a NFC tag for turning bluetooth-tethering on/off on my 
>> android phone. 
>>
>> I found no app that supports this function. There is the opportunity to 
>> write an URI on the tag in order to open e.g. an application.
>>
>> So is there a chance to use such an URI or a 'code' that I could write on 
>> the tag to turn bt-tethering on/off.
>>
>>
>> Thanks in advance!
>>
>> Best regards
>>
>> Daniel Kußmaul
>>
>

-- 
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/ae4eca8b-8d03-4d01-afc6-f94b5829245e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Disable home button

2015-12-31 Thread Ankush Jain
Is there any way to disable home button as done by

Mx Palyer(kids pugin required)
https://play.google.com/store/apps/details?id=com.mxtech.videoplayer.ad=en

or 

Picturesque(works without any plugin)
https://play.google.com/store/apps/details?id=com.microsoft.androidapps.picturesque=en
 
I have tried 
https://gist.github.com/Epsiloni/8303531
(does not work on android 5.0+)

-- 
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/1e1cf462-81ae-4839-bbe0-a13fd6b42b8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] How to replace FloatingActionButton icon with my own icon in Android Studio 1.5.1?

2015-12-31 Thread Clint William Theron





Hi super beings:-) Can you tell me how to change the icon of a 
FloatingActionButton? I tried File -> New -> Asset Image and in the src 
property I tried to change the path to the newly added icon. Attached is 
the xml and the image...Can you tell me how to do this right? Thank you in 
advance

-- 
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/c9fb9a1f-39e0-49e4-8464-ed6b379aa607%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: App unfortunately closed in Android emulator. Help me

2015-12-31 Thread Vijay Gurumukhi
Agree with Davi comment, please check your xml file those load in Activity 
also check id for listview 
Thanks 
Vijay Guru.

On Tuesday, 22 December 2015 13:30:40 UTC+5:30, Chithra Sarathy wrote:
>
> Hai to everybody,
>
>  I try to call web service in android 
> android. but the application is unfortunately stopped. The warning is 
>
> *1. *Process: com.example.pc3.webserrest, PID: 2260
> *java.lang.RuntimeException*: Unable to start activity 
> ComponentInfo{com.example.pc3.webserrest/com.example.pc3.webserrest.MainActivity}:
>  
> java.lang.RuntimeException: Your content must have a ListView whose id 
> attribute is 'android.R.id.list'
>
> at 
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
> at 
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
> at android.app.ActivityThread.-wrap11(ActivityThread.java)
> at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
> at android.os.Handler.dispatchMessage(Handler.java:102)
> at android.os.Looper.loop(Looper.java:148)
> at android.app.ActivityThread.main(ActivityThread.java:5417) at 
> java.lang.reflect.Method.invoke(Native Method)
> at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
>
> *2.* 
>
> Caused by: java.lang.RuntimeException: Your content must have a ListView 
> whose id attribute is 'android.R.id.list'
>
> at android.app.ListActivity.onContentChanged(ListActivity.java:243)
> at 
> com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:398)
> at android.app.Activity.setContentView(Activity.java:2166)
> at com.example.pc3.webserrest.MainActivity.onCreate(MainActivity.java:53)
> at android.app.Activity.performCreate(Activity.java:6237)
> at 
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
> at 
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
> at 
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
> at android.app.ActivityThread.-wrap11(ActivityThread.java) 
> at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
> at android.os.Handler.dispatchMessage(Handler.java:102) 
> at android.os.Looper.loop(Looper.java:148) 
> at android.app.ActivityThread.main(ActivityThread.java:5417) 
>

-- 
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/185cd527-1ffa-436d-9edc-022c6c893c91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: How to store videos with similar naming scheme as stock camera, but in custom camera app

2015-12-31 Thread David Karr
A negative confirmation is better than nothing, so thanks for that.  At 
least I don't have to try any more variations of the scanner code.

On Tuesday, December 29, 2015 at 12:17:23 AM UTC-8, gjs wrote:
>
> Hi,
>
> I don't think you'll get the confirmation you are seeking, but here's what 
> I think is currently happening.
>
> (1) The (Google) Gallery app is no more, now being replaced by the 
> (Google) Photos app.
>
> (2) Currently the (Google) Photos app appears to ignore the 
> MediaScannerConnection calls and / or does not query the associated Media 
> repository (/database) where media metadata is cataloged nor listen or act 
> on any associated Content Providers etc.
>
> (3) The (Google) Photos app currently seems heavily invested in using 
> (Google) cloud storage to backup and sync all your photos from all your 
> devices mobile & desktop. From some tests undertaken just now I've found 
> that photos from third party app won't show up in the (Google) Photos app 
> unless you explicitly turn on sync'ing and backup (via its settings) 
> and explicitly select your third party app media folder(s). You 
> won't necessarily see photos taken very recently (with 3rd party app) in 
> the main photo view and you might see these in the Device Folders view (on 
> some devices), eg: I can see a recent photo taken on a Nexus 6P, but I 
> can't yet on an Xperia Z5.
>
> (4) The (Google) Photos app is overly ambitious(?) with many moving parts, 
> seeking to do all sorts of things, grouping stories, show what you were 
> doing on this day in previous years etc etc etc, but can't get the basics 
> to work *reliably* such as show all photos on the device, sharing & getting 
> sync'ing to work consistently, (unless perhaps you only use the default 
> camera app). On the Xperia Z5 sharing a photos currently crashes 
> the (Google) Photos app... The help suggests things like turning off 
> syncing and turning it back on again when it's not working...
>
> (5) Google has a habit of consistently changing the Photos apps every few 
> months or so both on mobile and on the web, so what might work now it bound 
> to change and be broken again in future.
>
> (6) If you want to be certain that photos, videos captured with you app 
> are present on the device then you need to provide you own viewer activity 
> of some sort as previously suggest, or else be willing to help your users 
> get the (Google) Photos app configured to find photos, video created with 
> your app and be ready to do that all over again with next the (Google) 
> Photo app updates.
>
> Regards
>
>
> On Tuesday, December 29, 2015 at 6:37:32 AM UTC+11, David Karr wrote:
>>
>> I'm still hoping to get some help with this.  I've made no progress on 
>> this.
>>
>> I've yet to get any confirmation that something like this can even do 
>> what I think it's supposed to do, which is make videos recorded by a custom 
>> app be visible by the "Photos" or "Gallery" app, as if they were recorded 
>> by the stock app.  What I've read implies that this will happen, but I've 
>> yet to have this confirmed.
>>
>> The versions of this that I've tried both call the "completed" callback 
>> (except for the simple "sendBroadcast" variation), but that's the only 
>> indication I get that the process did anything.  Despite the "completed" 
>> callback being called, the recorded videos are never visible in the 
>> "Photos" or "Gallery" app.
>>
>> On Saturday, December 19, 2015 at 9:58:02 AM UTC-8, David Karr wrote:
>>>
>>> Because I can't bring up the stock camera app with just a video 
>>> record/stop button (I'm using a remote bluetooth button to start/stop 
>>> recording), I've written a custom app that just displays the camera preview 
>>> and a video record/stop button.
>>>
>>> Despite the fact that this is a custom app, as much as possible I'd like 
>>> to store the videos as if they were taken with the stock app.  This at 
>>> least means storing them in the same place, with a consistent naming and 
>>> metadata scheme.  I might consider having custom preferences in the app, 
>>> but for now I'd just like to retrieve properties that will tell me where 
>>> the stock camera app will store videos, along with any other configuration 
>>> that should describe how I store the videos.
>>>
>>> How can I get this information within my custom app?
>>>
>>

-- 
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/997d84fa-9d06-4bab-a7ac-8b050d3d9ccc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Replacing the settings menu(...) with button items.

2015-12-31 Thread Clint William Theron


The menu I'm talking about is contained in the following markup:




-- 
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/8ee7c825-8b9f-4b4e-9dda-62ecc3a9d4ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Replacing the settings menu(...) with button items.

2015-12-31 Thread Clint William Theron
Hi power code writers:-)
I chose one of your templates (I think it's the blank or empty one) and I 
really like the top-right menu, it's the one with the three dots vertically 
on top of each other. Anyway, when we tap this button a popup container 
appears with the word settings in it. I hope you know exactly to which 
button I'm referring to. Now instead of the word settings I would like to 
replace that with 3 buttons in that container. So when I click the 3 
vertical dots (...) the three buttons should popup. The button's icons will 
be replaced with my icons. 
Can we do this? Let me know how to do this and
thank you in advance.

-- 
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/5281a29f-efd3-494b-938f-1ba7dfa2df1d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] help on setting Android Studio in a pc with SDK installed

2015-12-31 Thread Angelo Giammarresi
Hello,

I have already installed in my PC Android SDK till v 20 because previously 
used with Eclipse 3.7.2

I want to install Android studio now.
If I download the bundle will it erase previoslu SDK version or only update 
the folders adding new missing version?
Is better download only Android Studio and later update SDK from inside it?

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/345078b3-38fb-4c06-b0ee-188b5280ba8f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Re: Building user interfaces at runtime with layouts from server

2015-12-31 Thread Luis Carlos Ramírez Rodríguez

It's been six years and I'm also looking for a solution to bind User 
Interface with layouts stored on a remote server and i was wondering if you 
ever managed to solve this issue

Thanks.

-Carlos

El lunes, 23 de marzo de 2009, 1:10:22 (UTC-6), Daniel escribió:
>
> Hi all, 
>
> Q: What is the recommended way to build user interfaces on the device 
> based on layouts provided by a server at runtime? 
>
> I am aware of this: 
> http://developer.android.com/reference/android/view/ 
> LayoutInflater.html 
> "> 
>
> For performance reasons, view inflation relies heavily on pre- 
> processing of XML files that is done at build time. Therefore, it is 
> not currently possible to use LayoutInflater with an XmlPullParser 
> over a plain XML file at runtime; it only works with an XmlPullParser 
> returned from a compiled resource (R.something file.) 
>  
>
> I could imagine these possibilities: 
> - Parse XML by myself and build the ui tree. (Seems inappropriate to 
> me since there is already maintained code which is able to do this.) 
>
> - Transform XML on server to a simpler format which is cheaper to 
> parse on the device. (Inappropriate  as above.) 
>
> - Preprocess the XML layout on the server the same way the build does. 
> Transmit it to the client, and then try to load it. But how? 
> android.content.res.XMLBlock is hidden (@hide) and I don't know how 
> to 
> classify the stuff in package com.android.layoutlib.bridge. 
>
> Any help would be appreciated. 
> Daniel 
>
>
>
>

-- 
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/c09b3558-e006-436c-a1dd-2b0266a2ba7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.