I am developing a UWP app and I have the UI part of the app developed in javascript. I am wondering if I can embed or integrate this UI javascript in the UWP application, or I need to rewrite the whole UI in UWP. Does anyone know?
Thanks in advance!
There is logic of Webview.
In which you can define URL for your Application and it loads same in a App as if it was an App.
In windows soemthing like thsi
In XAML
<WebView .../>
In class
try
{
Uri targetUri = new Uri(Address.Text);
webView1.Navigate(targetUri);
}
catch (FormatException ex)
{
// Bad address.
}
You ca see more detail here
UWP supports JavaScript directly. You don't have to choose either/or.
You can create a new project in Visual Studio from a JavaScript template and then copy in your existing HTML and JavaScript.
New Project -> JavaScript -> Blank App (Universal Windows)
See Create a "Hello, world" app (JS) in the UWP docs on MSDN.
You can optionally add .Net or native code to your project by creating Windows Runtime Components and calling them from your JavaScript code.
If you prefer to have your HTML/JavaScript as an island inside an otherwise Xaml UI then you can do that by hosting the HTML/JavaScript in a WebView. You can then write the rest of the app in Xaml and your choice of .Net or C++.
Related
I'm searching about how to expose some functionalities from my android app to a webpage using content provider.
My app stores digital certificates in AndroidKeyStore, i'd like to list this certificates on a webpage using js.
You can do a native app, in java and c++ or an html app with cordova or similar. Content provider belong to native app world. If you need to work with them, i suggest you to build an native app (in java) and do user interface natively.
The best way to do it is using Android WebView and exposing some functions to javascript.
https://stackoverflow.com/a/10389678/2004555
I'm developing an universal application using Cordova.
I want to add some features, for example authentication via Touch ID (fingerprint auth). In order to do this it's requested not to use a framework/library from Github/Internet so I want to do it in native code (Objective-C for iOS, Java for Android etc).
My problem is: since my app is a standard client application which uses HTML, Javascript (AngularJs) and CSS, how can I invoke some native code within the app life cycle? For example, if I'm inside a specific page (HTML) of my application, can I call an Objective-C method which implements the fingerprint authentication?
Any help is appreciated!
Can I write a offline only application using HTML, CSS and Javascript ( + AngularJS) for mobile devices (for example with cordova), so the user won't need any internet connection to start and use the application. As far as I know cordova just creates a webview and I wonder now, how will the page be shown, when there is no hosting...
Imagine a simple calculator or todo app which works just offline.
Is this possible? Or do I have other ways except cordova...
The pages are hosted inside the app. The html,js,css files are packed inside the apk. When a user install the app it download the pages within the app. And webview access the pages locally. So you can make app both online and offline.
suppose the android project directory. Html pages are kept in the directory
yourprojectfolder\android\assets\www
And in the java file at the app start it just create the webview and call the index.html page. Now if you need any device function like notification / geolocation you can use them using plugin. Plugins are those that creates bridge between html and java files.
Also several databases are available for phonegap development. So you can store data locally. Go through the documentation for more and create & understand the structure.
I am stuck at this problem. I have two Projects in Windows Phone 8.1 (WinRT), one project is C# Windows Phone Project named "CSharp_App" and the other project is JavaScript Windows Phone Project named "JS_App". Both of the Projects are under a same solution.
Now, my question is, is it possible to navigate from the C# App to the JavaScript App?
Suppose I have MainPage.xaml and MainPage.xaml.cs. I want to navigate from MainPage.xaml.cs to default.html - is it possible? Any help will be really helpful. Thanks in advance.
No, within the same app you cannot navigate from a XAML page to an HTML page.
You can use the WebView XAML control in your C# XAML app to embed HTML in your XAML application as a control. However the HTML is displayed as it is displayed in the browser and has no access to WinRT.
You can have two different apps, one C# and one JavaScript and have them register to handle a custom URI scheme which you can launch to get from one app to the other.
But if you're trying to create a sort of hybrid XAML+JavaScript app, that isn't really supported for Windows Phone 8.1
I am interesting in making an android application, while my primary hobbies is web development. Now the thing that is confusing me is that people make applications in HTML5/CSS3/JavaScript languages, are those apps running on web browsers on android mobile or running like an installed application on android?
Well you can design and develop your app in 3 ways
Native: full Java code in Android case, or Objective-C or Swift now in iOS
Web: HTML5, CSS3, JavaScript
Hybrid: a mixture of the two
If you are a web developer you can design your app in HTML5 and then use a wrapper like PhoneGap or Apache Cordova which will simply wrap or package your app in a WebView (a Webview is like a simple browser inside a native app).
Then you will have your APK like any other app in Google Play, so yes it's a full application that can be installed, updated and deleted of course, in any Android device
But there is a difference between the two, like the speed varies depending on the app type:
previously, web apps couldn't gain access to the accelerometer, camera, gyroscope etc, but now with the bunch of APIs available, you do have the ability to access them in very simple ways.
A full definition of a webView
The WebView class is an extension of Android's View class that allows
you to display web pages as a part of your activity layout. It does
not include any features of a fully developed web browser, such as
navigation controls or an address bar. All that WebView does, by
default, is show a web page.
More info about WebView Here
Yes they can be opened in web browsers. Those mobile application that is written in HTML5 are really web applications that have Mobile user interface. You can create and experience these projects using Visual Studio 2012. Go to new project -> Web -> ASP.Net MVC 4 Web Application -> in "select a template" choose Mobile Application