I am trying to implement a sample application using the Media Router API and the RemotePlaybackClient class. I do not want to implement Google Cast SDK (simply because I want to support other remote devices than Google Cast ones).
Everything works quite fine until I want to retrieve the session currently playing on the remote device.
By that I mean that for example, I have a mobile device A casting to a specific remote player (RM) with my sender app. If I kill my app, then launch it again, how can I retrieve the info of the current playback session on the remote device ? The same situation occurs if I try to select the media route from another mobile device B with the same application.
Also, how should this be implemented on MediaRouterProvider side ?
When you use Netflix for example, it is able to retrieve info of the currently playing session, up to the item currently playing.
There is not so much documentation on the subject, and the samples provided by Google do not seem to implement this feature.
Fling can also be implemented using RemotePlaybackClient, and specifies at the end of their online doc that some callbacks are just not called at all by Cast devices (#CommonsWare also noted that).
Found this subject, but no answer to this specific situation has been provided.
Any idea ?
Thanks !
Edit: Basically, I am trying to join the current session from another device / instance (feature is available for the Cast SDK). How can I do that using the media router provider ? There is no application id using only the media router...
The feature you are talking about (i.e. joining an on-going session) is a Cast feature and not supported/covered by Media Router. The reason that apps such as Netflix can do that is because they are using the Google Cast SDK.
Related
I have a new project at hand where I need to make two android applications
1)Main Controller application (be installed in one device say its name be X)
2)Sub Child application (be installed in devices that need to be controlled by X )
So I want to get an idea/picture about how one android device like (2) can be managed fully(i.e. blocking applications or making them accessible for some interval / block calls / track location of user ) from another device like (1). So far I searched Google ,asked my seniors about the same but none was able to help me out.Found many scattered info (like need enterprise app to do this i.e use android management API or Device admin ) but not being able to get any clear idea about the work flow.
Thus now this the last place I can think of for helping me out with this work flow.
Reference
Update: Based on what #Fred said i.e. to use android management API (also based on the answers that he posted here) could we somehow have own custom web server and manage the interactions that EMM console does with all the child apps through our own API's(the same API's which we would call from the parent app.) ???
In other words instead of controlling form the EMM console, I would like to control those child application from another parent android application.
By FCM or Socket programming you can easily communicate with other app. Suppose 2nd app receive a call then 2nd app call a api of server about the information, then server knock 1st app by fcm or socket, then 1st app make a decision and submit the decision to server by API, And finally server submit the decision to 2nd app by FCM or socket.
You can check out the Flyve MDM which is an open source mobile device management solution including both agent app and web panel for management.
I'm not going to use Intent to invoke default system Phone App, such as Google Hangout. Can we make a call or receive a income call inside our own app rather than system phone app?
Yes,You can do that with the help of a VOIP account. Try over internet you can find lot of VOIP providers and you just have to create an account and use the given instructions.
Android provides an API that supports the Session Initiation Protocol (SIP). This lets you add SIP-based internet telephony features to your applications. Android includes a full SIP protocol stack and integrated call management services that let applications easily set up outgoing and incoming voice calls, without having to manage sessions, transport-level communication, or audio record or playback directly.
Here are examples of the types of applications that might use the SIP API:
Video conferencing.
Instant messaging
Check this Example or Example 2
I am trying to create a real-time multiplayer game using Google Play Game Services. I am trying to set one player as host. Everyone will send their commands to the host (via sendReliableMessage), and they will receive a response of what to render.
However, I am trying to have the host send himself a message (before acting) in order to be in sync with everyone else, but the onRealTimeMessageReceived is not firing for the host when the host himself sends out the message.
Is it possible for the host to send a message to himself? If not, how would I go about this? The Google tutorial even says I should have a host player.
You cannot do this using the sendReliableMessage() function in RealTimeMultiplayer class. As written here, the function throws an IllegalArgumentException if recipientParticipantId is not a valid participant or belongs to the current player.
The thing that you need to do is to forward all received messages (sent by others) to a common class/method etc (depending on your design/wish) to keep clients updated and keep your game logic running and call the class/method manually for the host.
I am trying to make a mobile application for my Samsung Smart TV that would not only open one of the apps on the TV (e.g. Netflix, Pandora, Hulu etc.), but would also take in the 'extra parameters' to directly play the multimedia content for me on the TV rather than simply opening the app on the TV and me having to select what I want to play manually through the remote control.
Can any of these apps be invoked with 'extra parameters' (like, content id, song name, song id, TV show id, etc.) to play them directly? thanks!
Updated the question post Jeremy's response:
I used Wireshark on my android phone to trace the POST request that goes to Netflix on my PS3 to play a movie. The request is posted below. I am trying to reconstruct this POST request to play the movie "programmatically".
I see that the request has parameters "hmac" and "ciphertext", but I do not see any reference to the "movie_id" or anything like that in the POST parameters. I know that Netflix uses DIAL protocol.
Can someone help me understand how I can attempt to reconstruct the POST request and reverse engineer the request parameters?
Some of those apps do support the DIAL (DIscover And Launch) protocol, which allows for launching an app with parameters. Unfortunately, there are a few factors you have to deal with.
the format of the parameters is going to vary between each of the apps
the format of the parameters may be very hard to discover (try using a web proxy like Charles)
the handoff of parameters may occur in the cloud, rendering your use-case impossible
There is an open-source effort to normalize some of these launching commands. You should take a look at Connect SDK. They don't yet have support for Samsung, though.
I want to make a application that has similar function as Android Beam, but the question is how to get the content of those running apps. For example, if the web browser, Youtube and Google Map is running, how do I get the web address, the video link and the location? Thank You.
You will only be able to get information like this if the running application provides it through some sort of global access method, e.g. a service or content provider. It is highly unlikely that any application will do this as it has some serious security/privacy implications.
You will only be able to develop such an application by writing a system application aka you'll need root permissions.
The best approach in my opinion will be that you look through the Android Beam source code, to see how it's done there. The official API will not help you here. Since the functions used in such system applications is not in the API there is no guarantee that it will work with future versions of Android, so be careful.
I doubt that this will be an easy task. If it's really similar to Android Beam, try building your code on top of the official source.
For Android Beam, the app itself is sharing the data. The NFC background service gets the data to be shared via Android Beam delivered to it by the app's Activities. An Activity either calls at the beginning (e.g. in onResume()) the method NfcAdapter.setNdefPushMessage() to share a static piece of data or it calls NfcAdapter.setNdefPushMessageCallback() to register a callback that will create the data to be shared at the moment Android Beam becomes active.
A number of the standard Android and Google apps have been extended to support this in Android 4.0 ICS, for example Browser, Gmail, Maps, People and Youtube. Apps that have no support for this, will by default share a link to the download page of that app in the Google Play store.