Tutorial by Examples: dev

Example below shows how to create a BroadcastReceiver which is able to receive BOOT_COMPLETED events. This way, you are able to start a Service or start an Activity as soon device was powered up. Also, you can use BOOT_COMPLETED events to restore your alarms since they are destroyed when device is ...
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
Install webpack-dev-middleware via npm npm i -D webpack-dev-middleware webpack-hot-middleware Modify webpack.config.js Add webpack-hot-middleware/client to each items defined in "entry" Add new webpack.HotModuleReplacementPlugin() to "plugins" module.export...
To determine the latest tested/supported version of Node that can be used with your installed version of Meteor, dump the node version directly from the build tool's bundled node instance. meteor node -v
Git shortlog is used to summarize the git log outputs and group the commits by author. By default, all commit messages are shown but argument --summary or -s skips the messages and gives a list of authors with their total number of commits. --numbered or -n changes the ordering from alphabetical (...
git ls-tree -r HEAD | sed -Ee 's/^.{53}//' | \ while read filename; do file "$filename"; done | \ grep -E ': .*text' | sed -E -e 's/: .*//' | \ while read filename; do git blame --line-porcelain "$filename"; done | \ sed -n 's/^author //p' | \ sort | uniq -c | sort -rn
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]; ...
Install webpack-dev-server via npm. npm i -D webpack-dev-server Configure webpack-dev-server by adding server.js. // server.js var webpack = require("webpack"); var WebpackDevServer = require("webpack-dev-server"); var config = require("./webpack.dev.config...
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...
Node Version Manager (nvm) greatly simplifies the management of Node.js versions, their installation, and removes the need for sudo when dealing with packages (e.g. npm install ...). Fish Shell (fish) "is a smart and user-friendly command line shell for OS X, Linux, and the rest of the family&...
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...
In IDE Jaspersoft Studio (JSS) or the older version iReport Designer it is sufficient to press Preview. The JasperReports design file .jrxml will automatically be compiled to .jasper in same folder as .jrxml if no errors are present. Another way is to press "Compile Report" button in JSS...
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...
A JDK installation and a text editor are the bare minimum for Java development. (It is nice to have a text editor that can do Java syntax highlighting, but you can do without.) However for serious development work it is recommended that you also use the following: A Java IDE such as Eclipse, In...
adb shell am start -n com.android.settings/.DevelopmentSettings Will navigate your device/emulator to the Developer Options section.
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...

Page 4 of 9