VideoCast Sample App on Android does not detect cast device - android

I have downloaded and built the CastCompanionLibrary and CastVideos-android sample code from github, after updating google play services library etc.
I have modified the strings file to enter my AppId.
I have a test device configured in the developer console, and also I configured an app (is the sample video app in this case) and I entered the same package name as in the AndroidManifest.xml for the app.
The app start, runs and shows lists of videos - but does not seem to detect the chromecast device as on button is added to the ActionBar.
I am now trying to publish the sample app to see if that fixes it, but following the instructions and using the stock sample code is not working for me so far.
What am I doing wrong?

Andrew, which XML file you were referring to that had Pay Service version stuff in it? As to your issue, my suggestion is:
(1) Make sure your devices is whitelisted for your app. I imagine you are creating an app id on the dev console and using that app id. If your device is whitelisted, you should be able to access it using a chrome browser at http://<chromecast-ip>:9222, if you cannot access that, your device is not whitelisted. To troubleshoot, take a look at this post.
(2) After your device is set up for development, then make sure you put the app id in the strings.xml. Make sure your dependencies are set correctly: the companion library depends on appcompat and mediarouter from v7 of the support libraries, and rev 15 of play store library. The CastVideos-android only depends on the companion library.
If you follow these steps, all should work.

OK here is my summary of things I had to do to get things working with an unpublished app:
Double-check the Device ID. It's difficult to read and some characters could be wrong. Taking a photo in good lighting is a good idea.
Configure the device in the dev console (https://cast.google.com/publish/#/overview), register it and wait. Then later I had to reboot my Chromecast device (in fact twice). I used the chromecast app (Mac OS X) which you can download from here: https://cast.google.com/chromecast/setup
I had poor Wi-Fi performance that made my Android device change WiFi SSID to a different one from where the ChromeCast was connected. Latest versions of Android seem to test response time and bandwidth and then may change if deemed "unstable" (I had it overloaded with downloads) and there is another better one available. So, double check you are on the correct WiFi on Android.
Off course, configure the app in the dev console and past the (Case Sensitive) app id into the app_id string in the strings.xml file in the Android res/values folder.
I think that´s all. Happy casting!

I have the exact same issue, the cast video sample app doesn't find my chromecast so it doesn't show the "cast button" in the action bar.
Like you, in https://cast.google.com/publish/#/overview i have set up a new Styled Media Receiver application with the Android platform and set the package name to : com.google.sample.cast.refplayer
Then i found this : https://developers.google.com/cast/docs/receiver_apps#default
So i changed CastApplication.java in the onCreate method :
APPLICATION_ID = CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID;
Now it works, i can see the cast button and send videos to my chromecast.
But i still can't use my own application to use my own receiver.

I published my application from the Cast developer console (https://cast.google.com/publish/#/overview) and that seems to have fixed it.
BTW: Other people may have had uppercase/lowercase problems with the app ID - but not me.

I took the advice of some google page, and took a photograph of my Chromecast close up....with that unreadable laser etched ID.....
Then I zoomed in and checked.....and yes, I had a '8' instead of a 'B' in my device ID, probably causing my device to be not WhiteListed as mentioned by Ali Naddaf.
I deleted the old device, and created a new one with the correct Device ID. Then I had to wait 15mins for it to be registered.
So, I changed the package name of the sample in AndroidManifest.xml, I created a new Android app in the dev console with that package name, and put the new App Id into the code (strings.xml) and rebuilt and deployed my Android app.
All that did NOT work and the chromecast did not appear......so for now, using a published app is the only thing that works for me.

Related

Are not-standalone (companion) Wear OS apps still allowed for submission on the Play Store, or are they always rejected?

Our Wear OS application, which is not a standalone application (it is a companion app of our smartphone app, it cannot be used without the smartphone app) keeps getting rejected by Google Play Policy team for the following reason : "Your application requires phone interaction for the watch version to function." even if we have clearly explained in our Play Store description that it is not a standalone application and cannot work when the smartphone app is not available.
Our application was previously accepted and published on the Play Store but we suspect a Google policy change even if we haven't found it clearly anywhere (we have only found recommendations which encourage standalone apps).
=> Are not-standalone Wear OS apps still allowed for Play Store submission or must our Wear OS app include at least a standalone feature ?
Thanks in advance for your help.
TLDR for those who don't want to read the whole message: I had to set the following flag in the watch app's manifest to get my watch app approved:
<meta-data
android:name="com.google.android.wearable.standalone"
android:value="false" />
The longer story
I don't believe that what they forced me to do makes any sense. My application is semi-independent according to Google's own documentation:
A watch app can be considered as one of the following:
Completely independent of a phone app Semi-independent (a phone app is
not required and would provide only optional features) Dependent on a
phone app If a watch app is completely independent or
semi-independent, it is in the standalone category. You must indicate
this categorization to the Google Play store by setting the value of
this meta-data element to true:
My app requires an initial initialization of 2FA accounts, which can be done from an Android phone or from an iPhone. In the second case the Android phone is not required. Google requested to write a "disclaimer", which I've added to the app's description, but that didn't have any effect, they continued rejecting the app. I've asked three times about what was wrong with the disclaimer, but the best answer I've got was:
As much as I'd like to help, I’m not able to provide any more detail
or a better answer to your question.
I've asked one more time about what's wrong with the disclaimer, didn't get any answer, set 'standalone' flag to false and got approved two days later.
The problem that Google created for me and my users was that going forward installing the watch app would be possible from an Android phone only and not from a watch directly. It means that iPhone users would either need to find an Android device to install the watch app or to use ADB, and I'm sure, the users will hate me for this change.
Once again, an impression is that Android is on its way to self destruction: new policies break the old apps, support doesn't exist and developers are forced to make changes that make customers unhappy.
It's not the first episode of this stupidly, just recently I had to disable GDrive functionality in my Android app because new policies broke the existing logic that worked for years, and all OAuth 2.0 processes that Google suggested to be compliant with the new policies were not feasible for a small company
Here is a fragment of my comms with Google that fell on their deaf ears

Android APK file scanned with virus tool showing Trojan-Spy.AndroidOS.Agent

I have developed one Android App and published on the Google play store. but when a user runs an antivirus app, my app is showing Trojan-Spy.AndroidOS.Agent. becuase of this user has delated App.
Is there any way so that I can assure that my APK file is virus-free. I am new for Android.I used the virus tool (https://www.virustotal.com/gui/home/upload) to identify it. only Kaspersky found this. All other engines did not detect any virus.
How I can find what is wrong with APK
It’s related to your permissions that u got in app manifest.
But maybe another issue like:
1.foreground service with open mic or camera
2.background service with a high usage
3.http url in your api calling
and so on
Finally, I contacted Kaspersky Technical lab and shared the infected file. after 3 working days, I got a mail that it was a false detection. So my problem got resolved.

How to make a private Chromecast app, not meant to be published?

I have downloaded the CastVideos-android and made changes to it so it fits my needs... But probably only my needs! It will not be usable by anyone else, this is for my intranet configuration only...
It works fine using the app_id provided in the refplayer, but changing it to my own app_id, the Chromecast icon doesn't show up. This has to do with the app not being correctly registered at the Dev Console, but...
Since this is an app that is never meant to be published, what do I do to make the icon appear and my app to work for me, myself and I alone?
Thank you!
You can login to your Cast Developer Console and add the serial numbers of the Chromecast devices that you own. Doing that allows those cast devices to recognize your unpublished app; for a small number of Cast devices, this is a pretty manageable solution.

How to use basic4android exported apk

I am a .net developer but new to android programming. I have used basic for android and set to compile & run project into my LG device. Everything is good but my question is when I compile and run, everything is done?
Can I use the exported application file in the project folder in any device? I wrote a app and send it to my other galaxy phone, it worked! But when starting app, it works but first showing message: "Waiting for IDEdebugger to connect", what is this?
thanks for your help.
Before you package your application in b4a for other users or uploading to store, you have to change the compilation mode from debug to release or release(obfuscated).
If you compile in debug mode, that is when if you share the application to different users, it will always launch with the information waiting for ide debugger.
The app will work upon the platform which you choosed when you started your project. See what platform you choosed I remember there are Android , android icecream sandwich ..etc
So upon your choice you can know what devices you app will work but take care about the screen dimensions variations because this may cause problems in the way of the design is displayed so you should create scale just to be safe.
To get rid of that error you should uncheck Project->Attach Debugger. Also the file you will upload to Google Play Store or other places will be a .apk file in your objects subfolder. Basically you will need to either setup the Galaxy phone like your LG device or change the project to release and copy the .apk file onto your SD card and manually install it. For more information on your error a quick Google search led to a forum post on Basic 4 Android's forum. The link to that post is http://www.basic4ppc.com/android/forum/threads/waiting-for-ide-debugger-to-connect.13813/

Is it possible to manage NokiaX and Android source code in the same source control and IDE?

I have several Android apps which I want to upload to Nokia X store.
Some of the apps can run on the phone without any modification needed.
However some of them which used android specific services such as GCM, Google Map needs to be replaced with Nokia Push Service and Nokia Map. (According to the apk test tool)
Now my question is:
is there a way that I can still manage both piece of source code in the same version control repository?
can I configure eclipse to build nokia-x apk or android apk by some configuration?
The reason is 95% of the code are shared. Only GCM and Google Map are handled differently.
It would be a pain if I put them in 2 repositories.
If you check the documentation provided at the nokia site. The OneApk sections for each API would be explaining excat steps to achieve this.
Dr.Jukka has good point as developer.nokia.com documentation is covering this question.
Just to summarize what documentation says:
You should use same source code and even same apk file.
You can runtime-check if here maps are available and based on that select correct MapActivity or MapFragment: http://developer.nokia.com/resources/library/nokia-x/here-maps/one-apk-with-here-maps-and-google-maps.html
You can runtime-check if you should use GCM or Nokia Notifications by trying to use GCM and if it gives UnsupportedOperationException, you can catch that and use Nokia Notifications: http://developer.nokia.com/resources/library/nokia-x/nokia-notifications/one-apk-with-nokia-notifications-and-google-cloud-messaging.html

Categories

Resources