How to reconnect chromecast device when restart app in android - android

Hello every one i faced one problem regarding chromecast when i connect to chromecast device and remove app from background and after that again open app
but app disconnect to chromecast device can any idea to auto connect chromecast device to my app please suggest .

You can follow our documentation on this very subject, if yo want to do it yourself, or you can use Cast Companion Library that does it for you. In short, you need to persist a few pieces of data (such as session id, route id) and use them to perform reconnection.

Related

How to know that same app is install in another device or not via bluetooth

I have one Bluetooth application. If I install that app in 2-3 devices then How to know that same app is install in another devices or not like xender.
How to share local database of application via Bluetooth.?
You can Create UUID's for your Application and connect your application using that UUID.
While discovering devices, you can check whether the UUID of your application is supported by the other device. If yes, then you can display it, otherwise don't display !!
Something like this to initiate connection - device.createInsecureRfcommSocketToServiceRecord(YOUR_UUID);
For more insights, refer the BluetoothChat Application by Google, available at https://developer.android.com/samples/BluetoothChat/index.html

Exchange data between google-glass and a android device

The scenario:
I have a android app running my in cellphone. I´m the owner of this app.
I have a google-glass synced with this cellphone. I´m developing a my app for google-glass using the new GDK launch a few weeks ago.
I want to send a data from glass to cellphone and then receive a answer.
No internet connection is necessary, so i´m planning to use Bluetooth to this data communication.
I can create a Bluetooth socket connection, however this will obligate me to manage it.
There is no android high level abstraction that permit me to call a service or a activity directly on the cellphone?
AFAIK, there's no direct pipe between them, the glass is basically a phone with a different set of inputs and outputs. You can create and manage the connection, and it's yours.
AFAIK, there is no other way to do this, as Travis said there's no direct pipeline between them, seems to be true. You can use use BLUETOOTH Chat Application included in the Android SDK.
Just change the input method to voice input in the application
Install that Application in both the devices
Try It
change the code accordingly to send files too.

Device Administration App Remotely clear data on Android Phone

I am creating a application in android similar to Device Policy Administration that can remotely clear the data on the Android device.I have followed the sample in the android docs here http://developer.android.com/guide/topics/admin/device-admin.html
I need some assistance on how this is implemented.I have come across some apps that perform such tasks of remotely accessing the device(like clear data on the device,Ring the device to full volume).My doubt is
1.How did they implemented this functionality in android what concept have they used to send request to the app to ring the device?Is it via Push notification?
2.Also even if i mark Settings->Security->Device administrators->Android Device Manager(ADM)->Deactivate and from the console (https://www.google.com/android/devicemanager?u=0)
I Ring the Device...the device Rings.Shouldnt it not ring until and unless i dont activate the ADM.
3.Also even if i do not launch(start) the app ,I am still able to Ring my device.Does it mean that whenever i start my device my Device Administration App gets launched automatically?
Any help will be highly appreciable.
How did they implemented this functionality in android what concept have they used to send request to the app to ring the device?Is it via Push notification?
The Android Device Manager is a proprietary service and piece of software. You will need to get a job at Google, join the ADM team, and then learn how it is done.
That being said, a GCM-style push notification is a likely solution.
Does it mean that whenever i start my device my Device Administration App gets launched automatically?
No. Device administration != always running. Device administration status simply gives you access to other APIs that normal apps cannot use.
Note that a GCM-style push notification can be delivered to an app that is not already running.
The rest of your question has nothing to do with programming and everything to do with the proprietary implementation of ADM, which makes it off-topic for StackOverflow.

can't find chromecast device using Google's sample app

Using this code, https://github.com/googlecast/cast-android-sample, I build android chromecast sample sender application.
And I also modified the code to use my appID, and uploaded whitelisted URL (already registered to Google).
But I can't find the chromecast device from this sample app. I mean, onDeviceAvailable() is not getting called. And I don't see any suspicious error / log while i am running the app.
is there anything that i need to try to see why i can't find the chromecast device?
(BTW, youtube app in the same device can find the chromecast device)
another question, which may not be related to the main question.
registering the device to have app_id, and whitelisted url is not mandatory step to find the chromecast device from app. right? I guess that registration step is needed for media stream not for device discovery.
can anyone share working sampleapp code / receiver.html? (for me to make sure that i didn't make a mistake..)
Thanks!
Did you try the Tic-tac-toe Android sample too? These two apps are using different ways of displaying the list of ChromeCast devices to the user.
Both sample apps work just fine for me. I used the default reciever.html and only added my own app id.
Technically it is not necessary to register the device to discover it on the network. You can try this app to find all DIAL devices: https://github.com/entertailion/DIAL
However, the Google Cast API wraps the DIAL discovery and they might be enforcing the app id requirement.
Ok, I think i found the cause (with help of you guys, thank you), but that does not mean that i can solve this.
TicTacToe is working because it does not need my app id. it's using something generally working (like what youtube / netflix is using).
I tried "TicTacToe" as app id for cast-android-sample app, and now it can see the chromecast device.
I tried my app id to TicTacToe and it can't show the web page on the screen. (of course i modified my receiver page that is whitelisted)
From above 2 test results, i am confident that there is something wrong with my app id.
How to solve? should i reply to "nobody#google.com" who gave me the app id? or should i register my device again? (is this ok?) i am not sure.... can anyone tell?
Assuming that you've also changed the settings on the Chromecast to send the serial to Google, then you may just need to wait a few hours after doing so. I was having the same issue where my device wouldn't show up with the sample app, after waiting a few hours after changing that setting it showed up just fine.
Did you try rebooting your device by going into your Chromecast settings via the Chromecast Android app or the Chromecast app for your computer?
I spoke to the Chromecast support team because I was having the same issue, and the reboot got it working.
To make sure that your device is whitelisted, you should be able to access this page from chrome (from a computer on the same network as your chromecast device):
<IP address of chromecast>:9222
If you can access that page, then it should work!

Treat Android Phone as remote controller to other Android phone

I am working on the Final Year Project whcih require to use one android phone to control other phone via blue-tooth or wi-fi. I am very new for this area so I have no idea where should I start it.
The basic require is the controller can swap the screen and tap the object. Is there any site or example I can refer to ?
Here is the example app I find on Internet
http://www.addictivetips.com/mobile/tablet-remote-control-one-android-device-with-another-via-bluetooth/
So I am wonder if I can use GesturesBuilder to write this app? As one phone be the server and one as client. I making action on server and the client will receive the signal to perform the same action.
Thanks.
You can use socket programming to do this. See here: http://thinkandroid.wordpress.com/2010/03/27/incorporating-socket-programming-into-your-applications/
That app is bluetooth remote control andoid app
https://play.google.com/store/apps/details?id=com.shakej.blectrl.toll

Categories

Resources