Can't find my programs on the Watch Next row on Android TV Home - android-tv

I am trying to add video programs from my app to the Watch Next row on the Android TV Home. Here's my code snippet:
content.put(WatchNextPrograms.COLUMN_WATCH_NEXT_TYPE, WatchNextPrograms.WATCH_NEXT_TYPE_CONTINUE);
content.put(PreviewPrograms.COLUMN_INTERNAL_PROVIDER_ID, programId);
content.put(PreviewPrograms.COLUMN_INTENT_URI, IntentUri);
content.put(Programs.COLUMN_TITLE, title);
content.put(Programs.COLUMN_SHORT_DESCRIPTION, description);
content.put(WatchNextPrograms.COLUMN_LAST_ENGAGEMENT_TIME_UTC_MILLIS, timeMilli);
content.put(PreviewPrograms.COLUMN_LAST_PLAYBACK_POSITION_MILLIS, progress);
content.put(PreviewPrograms.COLUMN_DURATION_MILLIS, duration);
Uri watchNextProgramUri = context.getContentResolver().insert(Programs.CONTENT_URI, content);
I did get a returned uri from the insert call, but I don't see this program showing up on the android tv home (I don't even see a Watch Next row). Am I missing something in my code or in the Android TV setup?
below is what my android tv home screen looks like and the Play Next Setting:

Related

Telegram Web Apps method Expand isn't working

I found that the method Expand of window.Telegram.WebApp object isn't working in the Telegram client for Windows and IOS on computers and tablets.
How to increase the size of Web Apps frame for those devices?
function buttonOn(){
// do something on btn click
}
let main_page = document.querySelector('#main_page');
if (main_page){
window.Telegram.WebApp.expand() //expand window after page loading
window.Telegram.WebApp.MainButton.onClick(buttonOn) //set func on main button click
window.Telegram.WebApp.MainButton.setParams({'text': 'Корзина'}) // set byn params
window.Telegram.WebApp.MainButton.show() //show telegram btn
}
Other button events
Remove the line from the function:
window.Telegram.WebApp.expand() //expand window after page loading
And call it in the beginning/at the top of your main javascript code. (The code that will start running once the user has clicked on the button)
Also, you can make your code a lot shorter by putting window.Telegram.WebApp in a variable like:
const tele = window.Telegram.WebApp; //Initializes the TELEGRAM BOT and
//Gets the user's Telegram ID from the Telegram API
tele.expand(); //Expands the app on the users' phone to 100% height
The reason is, probably, you are a bit incorrect in understanding what "expansion" is. This term could only be applied to mobile devices with OS such as Android or iOS. Web App is displayed there in such native component as BottomSheet with inserted WebView containing your web application. Initially, in mobile devices, application is being opened minimized (not expanded). To make it use maximum allowed height of screen, you could call expand() method. It must work through window.Telegram.WebApp.expand().
In desktop or web versions of Telegram, Web App is displayed in separate component which is not allowed to change its size.
You could probably find more useful information about viewport and expansion here, or use alternative libraries, such as twa-bridge or twa-sdk

Whatsapp share link not working from mobile

I am using aspx to initialize the whatsApp click to chat feature to share a link.
The aspx code is :
The link was working fine. I was able to share the link. But in the recent months i am not able to share the link as i get a message from whatsapp in my mobile displayed as
Couldn't open link
Screen Shot:
NOTE: I am able to share from web browser but not from my mobile.
Is there anything wrong in the syntax or has whatsapp updated their feature, but i dont think so as their docs are still having the same info ?
Edit: The output url looks like this in chrome inspector:
https://wa.me/?text=https%3a%2f%2fwww.website.com%2fblog%2fPageName.aspx%3fblog%3dtitleword-your-titleword-system-using-titleword%26id%3d10%26temp%3dq
For computers, you will want to use this link...
https://api.whatsapp.com/send?text=YourTextHere
Otherwise, if you use wa.me, you will get an error page, unless you have the phone number included. For example, this links to an error: https://wa.me/?text=SomeTexttoShare
Typically, you don't know the number, and you want the user to specify. In that case, you MUST use the api.whatsapp.com domain.
I tried the same link in different android browser(FireFox) and it was working fine.
For chrome i changed the link to this -> whatsapp://send?text=
My code:
string WhatsappShareURL = "whatsapp://send?text=" + Request.Url.AbsoluteUri;
hlWhatsappMobile.NavigateUrl = Server.UrlEncode(WhatsappShareURL);
For Computers:
I use this link -> https://wa.me/?text=
My code:
string WhatsappShareURL = "https://wa.me/?text=" + Request.Url.AbsoluteUri;
hlWhatsappWeb.NavigateUrl = Server.UrlEncode(WhatsappShareURL);
Then i toggle them in jquery:
$(document).ready(function () {
if ($(window).width() < 520) {
//Show mobile link
}
else {
//Show Web link
}
});

Azure AD (ADAL) Login Screen Loses Entered User Email on Device Orientation in Android Only-XamarinForms.Android

I have Xamarin.Forms application that authenticates user against Azure AAD using ADAL (Microsoft.IdentityModel.Clients.ActiveDirectory). That all works fine but on Android, device orientation looses user email on the Microsoft authentication screen.
Here I am in Portrait mode and I have entered user email:
Clicking on Next lands on screen asking to enter password. If I now rotate device on Android, it will return me back to blank screen above, user email I entered above is lost:
Device rotation should not return user back and re-prompt for user email again. It should stay on password prompt.
How do I prevent the rotation from re-prompting for user email? I dont want to disable rotation, I just want to prevent it from returning me back to screen that prompts for user email again.
This is Xamarin.Forms application and my MainActivity has already ConfigChages.Orientation attribute like below; however, this is not solving the issue:
[Activity(Name = "my.mainactivity"
, Label = "MyApp"
, Icon = "#drawable/icon"
, ConfigurationChanges = ConfigChanges.ScreenSize
| ConfigChanges.SmallestScreenSize
| ConfigChanges.ScreenLayout
| ConfigChanges.Orientation)]
public class MainActivity : Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
...
}
UPDATE
Even if I freeze orientation to Portrait before call to AcquireTokenAsync and unfreeze it after the call receives response, it still behaves same - it will still rotate the Microsoft sign in page even though I freeze its parent (MainActivity) to Portrait (which is the owner passed in PlatformParameters to the call to AcquireTokenAsync. So, my activity stays in portrait but that sign-in page still rotates and looses data. It appears that the WebView Microsoft uses internally in AcquireTokenAsync is not following orientation settings on the activity passed inside PlatformParameters to AcquireTokenAsync.
Confirmed by Microsoft that this is their internal issues. If you are also running into this issue on Android where device rotation returns you back to prompt for user email, you can follow up progress of fixes for both ADAL and MSAL here:
https://github.com/AzureAD/azure-activedirectory-library-for-dotnet/issues/1622 https://github.com/xamarin/xamarin-android/issues/3326
I use Entry at my side, adding ConfigurationChanges = ConfigChanges.ScreenSize| ConfigChanges.Orientation, it works fine.
If you still have this issue, I suggest you can follow the next steps:
1.on Forms PCL, you can override OnSizeAllocated to check screen orientation, like this:
How to detect screen orientation of the device in Xamarin.Forms?
2.On Forms PCL and Android, you can use MessageCener to subscribe and send data
3.override method onSaveInstanceState() and onRestoreInstanceState(), like this:
Handle screen rotation without losing data - Android
The issue has been fixed in ADAL Release 5.1.1, and will be included in the next version of MSAL (most likely 4.3.1).
This issue is caused by Microsoft's ADAL component Microsoft.IdentityModel.Clients.ActiveDirectory and it has been fixed in 5.1.0 version released just couple of weeks ago (current version is 5.2.0).
What I had to do in order to fix this issue is:
1. Update ADAL from 3.19.8 to 5.2.0 (everything below 5.1.0 has this problem)
2. Then modified AuthorityURL passed to AuthenticationContext c-tor from something like https://login.microsoftonline.com/my-tenant-id/oauth2/authorize to https://login.microsoftonline.com/my-tenant-id
Number 2 was necessary even though Microsoft claims in most places that the change is non-breaking change (they confirmed this is necessary).
After this, I was able to authenticate just like before but rotation on Android would not loose already provided user id and/or password.

Disable default Android TV navigation sound effect Programmatically

How to disable sound feedback effect in Android TV Programmatically. If i press navigation button while music service is playing, sound effect mutes music for second. Or may be there is some priorities for music service? Thanks in advance
You can change it via the AudioManager like this:
AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
audioManager.adjustStreamVolume(AudioManager.STREAM_NOTIFICATION, AudioManager.ADJUST_LOWER, 0 /*or: AudioManager.FLAG_SHOW_UI*/);
To get the current notification volume, use
audioManager.getStreamVolume(AudioManager.STREAM_NOTIFICATION)
Possible volume values are 0..7.
From API level 23, you can also use AudioManager.ADJUST_MUTE.

How do you bring a visible NativeWindow to the front of all applications in a Adobe AIR App

The application I'm working on is a HTML AIR application based on the AIR 2.5 SDK.
The application starts two windows: the first is a hidden window that registers it's self on the system tray (it's windows specific); the second is a visible lightweight window displaying showing various bits of information. Since the visible window is lightweight, there is no task bar entry to always the user bring the window to the front if hidden under other application windows.
The requirement is that on clicking the system tray icon the display window will be brought to the front.
My current solution looks something like:
function handleClick(){
var nativeDisplayWindow = findDisplayWindow();
nativeDisplayWindow.alwaysInFront = true;
nativeDisplayWindow.alwaysInFront = false;
}
function findDisplayWindow(){
// looks in air.NativeApplication.nativeApplication.openedWindows for the
// the display window and returns it
}
It works but really doesn't feel right.
I've tried using NativeWindow.orderToFront() & NativeWindow.activate() and various combinations of all the other method.
Is this the correct way to bring a window to the front of all application windows in AIR?
If you try casting your nativeDisplayWindow as a Window you should then be able to do something like:
function handleClick(){
var nativeDisplayWindow:Window = findDisplayWindow() as Window;
nativeDisplayWindow.orderToFront();
}
I don't know if this is what you are looking for or whether I've just repeated what you've explained?

Resources