Archive | ANDROID

RSS feed for this section

How to detect WebView Android and UIWebView IOS

Read first: Example User Agent Strings mobile How to detect WebView Android We see that, WebView user-agent string contains string Version, we do a test: Result: Other test: Result: So, we have method: How to detect UIWebView IOS Example: Result: Update:

Read full story Comments { 0 }

Example User Agent Strings mobile

User Agent Strings A browser’s user agent string (UA) helps identify which browser is being used, what version, and on which operating system. When feature detection APIs are not available, use the UA to customize behavior or content to specific browser versions. Like all other browsers, Chrome for Android sends this information in the User-Agent […]

Read full story Comments { 0 }

Cordova lesson 7: Test the App

Test the App SDKs for mobile platforms often come bundled with emulators that execute a device image, so that you can launch the app from the home screen and see how it interacts with many platform features. Run a command such as the following to rebuild the app and view it within a specific platform’s […]

Read full story Comments { 0 }

Cordova lesson 6: Build the App

Build the App By default, cordova create script generates a skeletal web-based application whose start page is the project’s www/index.html file. Any initialization should be specified as part of the deviceready event handler defined in www/js/index.js. Run the following command to build the project for all platforms: $ cordova build You can optionally limit the […]

Read full story Comments { 0 }

Cordova: how to fix error: The connection to the server was unsuccessful. (file:///android_assets/www/index.html)

how to fix error: The connection to the server was unsuccessful. (file:///android_assets/www/index.html) ??? There are three methods: Method 1: open file config.xml and add this line: Rebuild app, now success. Method 2: open file config.xml and add these lines Method 3: 3.1 Rename your index.html to “main.html” 3.2 Create a new “index.html” and put the […]

Read full story Comments { 0 }

Cordova lesson 5: Add Plugins

You can modify the default generated app to take advantage of standard web technologies, but for the app to access device-level features, you need to add plugins. A plugin exposes a Javascript API for native SDK functionality. Plugins are typically hosted on npm and you can search for them on the plugin search page. Some […]

Read full story Comments { 0 }

Cordova lesson 4: Install pre-requisites for building

To build and run apps, you need to install SDKs for each platform you wish to target. Alternatively, if you are using browser for development you can use browser platform which does not require any platform SDKs. To check if you satisfy requirements for building the platform: $ cordova requirements Requirements check results for android: […]

Read full story Comments { 0 }

Cordova lesson 3: Add Platforms

All subsequent commands need to be run within the project’s directory, or any subdirectories: $ cd hello Add the platforms that you want to target your app. We will add the ‘ios’ and ‘android’ platform and ensure they get saved to config.xml and package.json: $ cordova platform add ios $ cordova platform add android Result: […]

Read full story Comments { 0 }

Cordova lesson 1: Installing the Cordova CLI

The Cordova command-line tool is distributed as an npm package. To install the cordova command-line tool, follow these steps: 1. Download and install Node.js. On installation you should be able to invoke node and npm on your command line. Read more: How to install NodeJS on Centos 2. (Optional) Download and install a git client, […]

Read full story Comments { 0 }

Enable Auto Import in Android Studio

Introduce: By default, when programming languages such as C/C ++, C #, Swift, or Java, you must declare yourself the libraries that contain the methods or classes we use, with C/C ++ using #include, with C# uses using using with Swift and Java using the Import keyword. And sometimes they just remember the class name […]

Read full story Comments { 0 }