Windows phone app link - browser

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.

Related

Corona net::ERR_CACHE_MISS comes when loading an external url in Corona

I am using Corona to make an app. I have implemented following code to open a website/a page inside my app view instead of browser:
function openLink(event)
if(event.phase == "ended")then
print("btn clicked")
local webView = native.newWebView( display.contentCenterX, display.contentCenterY, 320, 480 )
webView:request( "http://www.coronalabs.com/" )
local text1 = display.newText("",100,100,native.systemFontBold,20)
text1.text = "native should come"
end
end
btn:addEventListener("touch", openLink)
Its giving me following error on device when button is tapped:
net::ERR_CACHE_MISS
Please help me out with this. Also, I have few questions regarding feasibility of this function.
Can I access full interactivity of website inside app view? i.e. scroll through pages, open other pages, navigate to other elements of website etc.
If I can't access complete website with ease, is there any possibility that I can open multiple pages one after another of same website on click of various buttons created by me inside app?
Any help is greatly appreciated.
The ERR_CACHE_MISS error comes from Chrome. To avoid it, check the following:
Make sure you can get to the URL from a browser on the mobile
device to ensure the issue isn't with your Internet connection.
Make sure that your build.settings file in your Corona app allows for Internet
permissions. For Android, this means including the following in build.settings:
-- Android permissions
androidPermissions = {
"android.permission.INTERNET",
},

How to open default browser in windows store 8.1?

I have an app needs to open a browser and link to the address that I want. My project is coded on windows 8.1. I have research on google but I couldn't find any solutions.
This code below is good when dev in Windows Phone:
Launcher.LaunchUriAsync(new Uri("link"));
But in tablet,it made my app hidden and didn't do anything else.
Please give me any solutions for this problem. Thanks
Please try below code. I have checked and its working fine.
LauncherOptions options = new LauncherOptions();
options.DisplayApplicationPicker = true;
options.TreatAsUntrusted = true;
var success = await Launcher.LaunchUriAsync(new Uri("Your Link"), options);
Here, if you remove options.DisplayApplicationPicker=true then it will open default browser. I added that line because it helps user to select different apps each time.

how to integrate vserv ads sdk to windows phone 8 application

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.

Invoking Browser via application Icon Like Youtube Application Without Showing My Application

i want to invoke browser with a specific url like youtube application. I've try using Navigator Invoke but, its show my application. i dont want to show my application just show browser when user click the application icon, can anybody help me please ..
Put this into your main() in main.cpp
QDesktopServices::openUrl(QUrl("http://example.com",QUrl::TolerantMode));
But you MUST remove (comment) the following lines:
new ApplicationUI(&app);
return Application::exec();
Otherwise application will open anyway

how to Zoom In/Out using Robotium?

i try to open web browser apk, open one web page.
is it possible to ZOOM IN/OUT of this web page using robotium ?
and i try to open one docx file using open Office apk automation using robotium.
is it possible to ZOOM IN/OUT for this document page using robotium ?
Any one have solution then please help me.
As far i know there is no functionality like that in Robotium.
For a web page you can use the zoomIn() method of a webview that you have gotten a reference to using any number of the ways you can with robotium.
To be able to use this method you will have to cast the view you got from robotium to a WebView and to perform the zoom you will have to run on the uithread. The code would look something like:
final WebView webView = (WebView) Solo.getView(R.id.web_views_id);
instrumentation.runOnMainSync(new Runnable() {
#Override
public void run() {
webView.zoomIn()
}
});

Resources