* -- The issue is my APP ID so as not to waste anybody's time.
On the off chance this helps some other noob the real problem was I forgot to check the:
"Send serial device # to Google when checking for updates" checkbox below the fold on the Chromecast device setup application.
I also then had to reboot my Chromecast device for this to take effect.
Now Naddaf's github works fine!
Before beginning: I have no problem casting examples that use ActionBarActivity so my chromecast configuration is definitely not the issue.
In reference to:
https://github.com/googlecast/MediaRouter-Cast-Button-android
There seems to be a bug in that
mMediaRouter.addCallback(mMediaRouteSelector, mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
located in: MediaRouterButtonActivity.java
NEVER receives a callback.
This was reported 4 days ago:
https://github.com/googlecast/MediaRouter-Cast-Button-android/issues/5
The long version:
I have a mature beta of my video based Android app that uses FragmentActivity and currently targets SDK 14+.
I have set up a Chromecast device for development successfully and it works with the sample apps in SDK/Extras just fine. The problem there is they all are predicated on inheriting from ActionBarActivity which is mutually exclusive/incompatible with FragmentActivity.
Every example from StackOverflow or github (only one project) that I have tried that uses android.support.v7.app.MediaRouteButton does run only the MediaRouteButton never instantiates.
When tracing I see that the following is the issue:
mMediaRouter.addCallback(mMediaRouteSelector, mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
The callback is added but the Chromecast SDK never calls back to it.
Google gives an entire walkthru using the ActionBarActivity but only makes a fleeting reference to the alternative use of the MediaRouteButton.
I have now wasted 2 days already trying to wrap my head around this but guessing one's way through it sub-optimal.
Is there anybody who has a working example of using the MediaRouteButton with FragmentActivity or a link to working documentation. This is now seeming like a major oversight by the Chromecast team.
Thanks!
Related
I'm trying to develop own Android application using ANT+ sensors.
My app is based on (developer's Sampler code and SDK).
However I found the strange thing during tests. I mean when I start to searching devices I immediately receive a message:
W/AntPluginPcc: BBD30600: RequestAccess failed: OTHER_FAILURE
At first I suppose that a reason of this problem is that I have a phone with Marshmallow OS (instead my wife's phone is based on Lollipop OS and all works fine). I tried to find anything in documentation related this but didn't find anything interesting. I add to Manifest some permissions (I mean com.dsi.ant.permission.ANT, android.permission.BLUETOOTH etc.) and set the permissions in code, but it doesn't help to me to solve my issue.
May be anybody received this problem and may be somebody solve it. Could you please share your solution to me?
P.S. I install the ANT+ Plugin services, ANT Radio Service. in App I use the ANT+ SDK from github. May be I should use also the ANT SDK? (I want to connect to HRM and cycle devices which use ANT+ protocol)
If you have the same problem as I you need to realize the AntRadioServiceConnection class.
I found it here.
And you should be sure that you have all services and plugins installed on your phone.
I need to detect user dynamics in my application. I started by using GooglePlayServicesClient which till three months ago worked perfectly, Then it stopped working on my HTC one device (although it was still working on three different devices I've checked). I know it is now replaced by GoogleApiClient, so I thought this was my problem, but it keeps not working even after changing to the new API.
The problem is that the intent given to ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates is never called. I used the same implementation as : https://blacode.wordpress.com/2014/12/26/user-activity-recognition-through-new-activityrecognitionapi-in-android-activityrecognitionclient-deprecated/
(And again, this implementation works on three other devices but not on HTC one).
I did some reading online and I saw some similar issues that were solved by updating google play or activating google play location services or disable mock location on the android developers settings. Non worked for me.
Has anyone encountered the same problem or maybe has some idea what can be the cause?
If your onHandleIntent is not being triggered, make sure you have a receiver tag in your manifest (inside the application tag, but outside the activity) :
<service
android:name=".ActivityRecognitionIntentService"
android:exported="false" />
I struggled with this for several hours before finally realizing this was missing. As soon as I added it, everything worked.
Also, if you add an IntentService class through the AndroidStudio submenu for IntentService instead of just adding a plain Java class and setting it up yourself, it will automatically be registered in the manifest. New...->Service->IntentService
Eventually what solved it was resetting the device to manufacturer settings, meaning that the problem was some setting in the device , which I still have no clue to what caused it. If anyone finds an answer I'll be glad to hear about it.
I've recently started android programming, and I'm extremely frustrated to say the least with a lot of things that to me seem simple but are totally holding me back from making any progress. The first of which is the "my first app" hello world that I started a tutorial from http://developer.android.com/training/basics/firstapp/creating-project.html
This tutorial worked fine when I was originally looking into android a while ago. Then when I came back after learning a bunch of java this program will no longer work unless I change the target-sdk to version 10 (I found that solution after extensive searching on this site).
Then I moved on to starting tutorials by thenewboston
All of these work fine as long as I didn't use any new targetsdkversion, so I'm wondering what happened that everywhere I go looking for tutorials I can't find anything that will actually work on the current ADT(4.4W and L are what my eclipse automatically set up) and eclipse (indigo). I'll also get issues saying lint isn't working, or trouble with android SDK content loader when I'm not even doing anything.
I've also found snippets of code example on the developer website that I linked earlier that don't work when implemented either
So, am I missing something, is that just old documentation, or is something up with eclipse and ADT? I'm just so frustrated that everything wants to bug out on me when I'm just trying to follow simple introductory tutorials and I don't even know where to turn for tutorials that I can trust to work..
edit:removed code because it wasn't needed.
To not get blocked What you can do is continue to set "targetVersion as '19'" instead of setting it to 20 or so. Ensure that you've downloaded API19 through SDK Manager and create the AVDs with that targetSDK version for checking you apps.
That way you can proceed ahead with your coding and later when things get resolved by google for API20...you can always comeback to that new version. This way you can follow 'TheNewBoston' and start coding in Android.
I also recommend 'Slidenerd' tutorials over youtube as well for the beginner.
BTW, I've also selected 'Blank Activity / Empty Activity" during the project creation with API19 and been able to move ahead with my coding.
The Google Bug thread about this latest version issue can be tracked here : The google bug
As a beginning developer, I suggest you use API 19. It has been out for a while and is more stable than L or Google Wear.
I know this question has already been asked here link1 and here link2 but neither have a proper solution so I'm hoping that someone may now know a solution as it's driving me insane.
I'm new to android app design using Eclipse and I created a simple "Hello World" app and wanted to test it but I can't because I'm getting the error:This class should be public (android.support.v7.internal.widget.ActionBarView.HomeView).
I never had this problem come up yesterday and today I haven't altered my code at all but the error pops up when I run Lint Warnings; stopping me from running the test emulator.
Does anyone have a solution to this problem at all or why it's suddenly appeared out of nowhere?
This has been logged as a bug: https://code.google.com/p/android/issues/detail?id=73265
If you've only created a hello world app, I'm a little unsure why you would need to pull in anything from the support libraries. The top answer on the second link should work (making sure lint flags it as a warning and not an error), but you could also make sure you set the target API level higher. I would suggest API 14 based on *current market share
So I downloaded the Sample App for 'Recognizing the User's Current Activity' on the android website http://developer.android.com/training/location/activity-recognition.html
The problem I'm having is that when I press the 'Start Updates' button, then the 'Stop Updates' button, and then the 'Start Updates' button again, the updates don't start again the second time.
I've searched online but couldn't find much material on the topic so yeah, I've also tried debugging and found that the onDisconnected() method call (via the ConnectionCallbacks interface) isn't being called in either of the DetectionRemover.java or DetectionRequester.java files.
If anyone knows why this is happening I'd really like to know why. From what I've gathered it doesn't seem to be anything in the sample code, and I think it might be a problem on the Google Services side.
P.S. I'm using Google Play services rev 16. along with a Samsung galaxy s2 android version 4.1.2
I noticed this same problem running the sample code on my Nexus 4 (Android 4.4.4). I found that if I commented out the following line of code in the ActivityDetectionRemover continueRemoveUpdates() method, it fixed the problem:
mCurrentIntent.cancel();
Sorry, I don't yet have a good explanation as to why canceling the PendingIntent causes this issue.
UPDATE: I also commented out the cancel in the MainActivity onStopUpdates() method:
mDetectionRequester.getRequestPendingIntent().cancel();
Which is effectively doing the same thing as the first line above.