I'm developing windows 10 UWP app. I need to collapse system tray only for Windows 10 Mobile app.
Finally I got answer
var statusbar = "Windows.UI.ViewManagement.StatusBar";
if (ApiInformation.IsTypePresent(statusbar))
{
//await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().ShowAsync();
await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
}
Note: Don't forget to add windows phone extention before using above code
Fore more Info:
https://msdn.microsoft.com/en-us/library/windows/apps/Dn609832.aspx
I find the way that can help you! u should use this code in the public MainPage() class
ApplicationView.GetForCurrentView().TryEnterFullScreenMode();
this code hides the status bar and make ur app full screen in phone
Related
basically I want to stop the lockscreen from kicking in on a windows 10 app while my app is running on windows phone 7+ it was PhoneApplicationService.Current.UserIdleDetectionMode now I cant seem to find a replacement.
You should use the DisplayRequest class.
When a display request is activated, the device's display remains on while the app is visible. When the user moves the app out of the foreground, the system deactivates the app's display requests and reactivates them when the app returns to the foreground.
Ref:
DisplayRequest class
Sample code:
var dr = new DisplayRequest();
dr.RequestActive();
// ...
dr.RequestRelease();
Currently, I found Windows.ApplicationModel.Calls API. unable to make a call or launch different options available to make a call from my app.
And also I try this Code but still can't implement the Phone call function, any solutions for UWP? Thank You.
if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1,0))
{
PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");
}
I've come with a solution that is working on emulator, I cannot test it on actual device, cause I don't own one.
PhoneCallStore PhoneCallStore = await PhoneCallManager.RequestStoreAsync();
Guid LineGuid = await PhoneCallStore.GetDefaultLineAsync();
PhoneLine = await PhoneLine.FromIdAsync(LineGuid);
PhoneLine.Dial(phoneNumber, nameToBeDisplayed);
You have to add Windows Mobile Extentions for UWP to references of your project as well as declare PhoneCall capability in app manifest.
The line,
PhoneCallManager.ShowPhoneCallUI("0213132131", "my name");
only shows the Call UI. It doesn't make a phone call.
You should use Windows.ApplicationModel.Calls.PhoneLine.Dial to make a phone call. See this for reference https://msdn.microsoft.com/en-us/library/windows.applicationmodel.calls.phoneline.aspx
See this example https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/PhoneCall/cs/Helpers/CallingInfo.cs#L85
I have developed a windows phone 8 application. Now I want to display vserv ads to my application.
I have added the sdk to my application and also applied code to show ads:
public MainPage()
{
InitializeComponent();
VservAdControl VMB = VservAdControl.Instance;
VMB.DisplayAd(zoneID, LayoutRoot);
VMB.VservAdClosed += new EventHandler(VACCallback_OnVservAdClosing);
VMB.VservAdNoFill += new EventHandler(VACCallback_OnVservAdNoFill);
}
void VACCallback_OnVservAdClosing(object sender, EventArgs e)
{
MessageBox.Show("Ad close by user.");
}
void VACCallback_OnVservAdNoFill(object sender, EventArgs e)
{
if (adGrid != null)
adGrid.Visibility = Visibility.Collapsed;
}
But after closing the ad the application page goes blank, all content, application bar automatically goes blank. After using back arrow that quits my application, i try to relaunch my application but application stuck at the splash screen on the emulator.
Wrap ad control inside a grid. Ad control could have manipulated the grid
I encountered the same issue and they have updated their SDK several times. If you provide the stacktrace they will provide you a fix.
Apart from what you have seen, there are other issues with the SDK. I integrated it few weeks back. So issues could have been resolved after that.
Memory leak. Click the ad or navigate back and forth - you will see the memory ever growing. This is because of events not being detached (withing SDK). I was consistently able to see my app crash in 512 MB emulator when banner ad is loaded (after 4 - 5 times). They could have used weak listeners. You might need to tweak a lot to overcome this issue (In multi page app)
RequestAdCallback throws null pointer exception sometimes crashing
the app. When people use app, they will navigate fast - forcing the
webbrowser to unload. All callbacks should be null pointer exception
free. Make sure that you handle unhandled exception globally otherwise app will not pass certification
It reads WMAppManifest.xml as text not as XML. So I had App element commented in first line before the actual one. It picked title from commented XML element
Application bar is manipulated in many events in the SDK. So you have to make sure that app bar is built dynamically. Test all navigation paths.
SDK assumes user will click the left arrow button which fires ad closing event. Try pressing phone back button instead. The app bar still disappears
SDK documentation requests app to demand ID_CAP_REMOVABLE_STORAGE capability. I don't see a reason to request this capability but I didn't add this
I have emailed them all these details. May be their latest SDK could have resolved these issues. But please do thorough testing after integration.
Add a function to load applicationbar using code
private void BuildLocalizedApplicationBar()
{
// Set the page's ApplicationBar to a new instance of ApplicationBar.
ApplicationBar = new ApplicationBar();
ApplicationBar.Mode = ApplicationBarMode.Default;
ApplicationBar.Opacity = 1.0;
ApplicationBar.IsVisible = true;
ApplicationBar.IsMenuEnabled = false;
// Create a new button and set the text value to the localized string from AppResources.
ApplicationBarIconButton button1 = new ApplicationBarIconButton();
button1.IconUri = new Uri("/Images/sms.png", UriKind.Relative);
button1.Text = "sms";
ApplicationBar.Buttons.Add(button1);
}
and then in VACCallback_OnVservAdClosing event handler call the function
BuildLocalizedApplicationBar()
Please check the following link,
where to add application id and adUnitiD while integrating vserv ads sdk to windows phone 8 application, which is related to your question.
So - I want to make a windows phone app that links to my webpage when I open it - how do i do that? I have the SDK, and tried with the browser, but I can't seem to find anyway to set a homepage?
You could use the WebBrowser control, placing it on an otherwise empty page. This may allow you to fine tune the experience if wish.
But what would be even easier is to just use the WebBrowserTask. This would launch you right back out of your app and into OS's true browser experience. In the App.xaml.cs file, just add the following code:
private void PhoneApplicationService_Launching(object sender, LaunchingEventArgs e)
{
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://my.superawesomewebsite.com", UriKind.Absolute);
webBrowserTask.Show();
}
You app will immediately launch the browser an you don't have to do anything else.
How to open link in webview in Blackberry like iPhone and Android ?
Which should not be open in Browser ,it should be opening in Webview through application .
The Blackberry equivalent of a WebView is a BrowserField. Example code from this page:
import net.rim.device.api.browser.field2.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
public class BrowserFieldDemo extends UiApplication
{
public static void main(String[] args)
{
BrowserFieldDemo app = new BrowserFieldDemo();
app.enterEventDispatcher();
}
public BrowserFieldDemo()
{
pushScreen(new BrowserFieldDemoScreen());
}
}
class BrowserFieldDemoScreen extends MainScreen
{
public BrowserFieldDemoScreen()
{
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
BrowserField browserField = new BrowserField(myBrowserFieldConfig);
add(browserField);
browserField.requestContent("http://www.blackberry.com");
}
}
Options Icon -> Host Routing Tables -> Register Now
If the above instructions failed, try stepping through these instructions one by one
* Try getting your service books retransmitted.
a. Login to your BlackBerry Web Client (BWC/BIS) site.
b. Click "Profiles" (At the top of your BWC webpage via your PC)
c. Click "Send Internet Browser Service Book"
* Try rebooting your BlackBerry by removing and reinserting battery.
* Make sure you are running BlackBerryOS 4.0 by checking:
Check Options -> About
If you are not running at least Version 4.0, you need to download and install BlackBerryOS 4.0 then repeating all the above instructions again.
* If that does not work, and you are on a BlackBerry Enterprise Server (BES), try re-activating your BlackBerry on BES. This may be as simple as connecting your BlackBerry to your PC and synchronizing your BlackBerry while Outlook is in ONLINE mode.
I think that you are looking for the BrowserField UI component.