Tutorial by Examples: device

Add the required network permissions to the application manifest file: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android....
In general, UWP is used for making a single application that runs on Windows 10 across many different devices. However, it is also possible to make code tailored to specific devices. You can achieve this in several different ways. Different XAML Layout If you want to use a specific layout on for a...
A Cordova application runs as a website on a WebView component within the native mobile platform. Debugging a cordova application can therefore be done by utilizing your favourite browsers development tools. The following steps are needed to hook the application, running on the device, to the Chrome...
The example below will collect the Device's OS version number and the the version of the application (which is defined in each projects' properties) that is entered into Version name on Android and Version on iOS. First make an interface in your PCL project: public interface INativeHelper { /...
Open Android Device Monitor ( ie C:<ANDROID_SDK_LOCATION>\tools\monitor.bat) Select your device Click on Screen Capture Button
2.1.3 1. Preview Different Devices There is a preview panel at the right of the android studio. In thispanel there is a button with device name with which you are previewing the UI of your app like this . Click on small dropdown indicator of this and a floating panel will appear with all the pr...
Add the following code to the onCreate()/onResume() method: SensorManager sensorManager; Sensor mAccelerometer; final float movementThreshold = 0.5f; // You may have to change this value. boolean isMoving = false; float[] prevValues = {1.0f, 1.0f, 1.0f}; float[] currValues = new float[3]; ...
Swift 2 import UIKit extension UIDevice { var modelName: String { var systemInfo = utsname() uname(&systemInfo) let machineMirror = Mirror(reflecting: systemInfo.machine) let identifier = machineMirror.children.reduce("") { identifier, ele...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['battery_service']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Battery Service... return server.getPri...
function onButtonClick() { navigator.bluetooth.requestDevice({filters: [{services: ['heart_rate']}]}) .then(device => { // Connecting to GATT Server... return device.gatt.connect(); }) .then(server => { // Getting Heart Rate Service... return server.getP...
Here a simple portable way to get the current device family: /// <summary> /// All the device families /// </summary> public enum DeviceFamily { Desktop, Mobile, Iot, Xbox, } /// <summary> /// The helper to get the current device family /// </summ...
Of course, the best way to detect mobile is for the hardware to notify you directly. Cordova PhoneGap exposes a 'deviceready' event, that you can add an event listener to. document.addEventListener('deviceready', function(){ Session.set('deviceready', true); }, false);
adb devices Is your phone displaying? If not, enable developer mode on your phone, and connect it by USB. adb reverse tcp:8081 tcp:8081 : In order to link correctly your phone and that React-Native recognize him during build. (NOTE:Android Version 5 or above.) react-native run-andr...
First, make sure your app can be backed up in AndroidManifest.xml, i.e. android:allowBackup is not false. Backup command: adb -s <device_id> backup -noapk <sample.package.id> Create a tar with dd command: dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.wri...
import serial #Serial takes these two parameters: serial device and baudrate ser = serial.Serial('/dev/ttyUSB0', 9600)
After you obtained BluetoothDevice, you can communicate with it. This kind of communication performed by using socket input\output streams: Those are the basic steps for Bluetooth communication establishment: 1) Initialize socket: private BluetoothSocket _socket; //... public InitializeSock...
The BluetoothLE API was introduced in API 18. However, the way of scanning devices has changed in API 21. The searching of devices must start with defining the service UUID that is to be scanned (either officailly adopted 16-bit UUID's or proprietary ones). This example illustrates, how to make an A...
File Structure: pom.xml src/test/java/PlayStoreAutomation.java Launch command: mvn test -Dtest=PlayStoreAutomation PlayStoreAutomation.java import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; import io.appium.java_client.android.AndroidDriver; import i...
Disable Private Browsing Open your device’s Safari settings and ensure that Private Browsing is turned off. Remote debugging will not work if Private Browsing is enabled. Enable Web Inspector Tap the Advanced tab on your device’s Safari settings and ensure that Web Inspector is turned on....
This example introduces the VideoCapture class, where we use it to take an image from a webcam and save it to an image. import org.opencv.core.Mat; import org.opencv.core.MatOfRect; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.Scalar; import org.opencv.imgc...

Page 2 of 4