Tutorial by Examples

A determinate ProgressBar shows the current progress towards a specific maximum value. Horizontal determinate ProgressBar <ProgressBar android:id="@+id/progressBar" android:indeterminate="false" android:layout_width="match_parent" android:layout...
If you have one of the supported Linux distributions, you can follow the steps on the .NET Core website: https://www.microsoft.com/net If you have an unsupported distribution: Download the .NET Core SDK from the links, picking the distribution closer to the used one. https://www.microsoft.com/net...
With more and more battery optimizations being put into the Android system over time, the methods of the AlarmManager have also significantly changed (to allow for more lenient timing). However, for some applications it is still required to be as exact as possible on all Android versions. The follow...
First, create a key file, e.g., vault_pass_file, which ideally contains a long sequence of random characters. In linux systems you could use pwgen to create a random password file: pwgen 256 1 > vault_pass_file Then, use this file to encrypt sensitive data, e.g., groups_vars/group.yml: ANSI...
With Vault you can also encrypt non-structured data, such as private key files and still be able to decrypt them in your play with the lookup module. --- - name: Copy private key to destination copy: dest=/home/user/.ssh/id_rsa mode=0600 content=lookup('pipe', 'ANSIBLE_VAULT_PA...
You can run a play which relies on vault-encrypted templates by using the local_action module. --- - name: Decrypt template local_action: "shell {{ view_encrypted_file_cmd }} {{ role_path }}/templates/template.enc > {{ role_path }}/templates/template" changed_when: False - ...
from __future__ import print_function import threading def counter(count): while count > 0: print("Count value", count) count -= 1 return t1 = threading.Thread(target=countdown,args=(10,)) t1.start() t2 = threading.Thread(target=countdown,args=(20,)) ...
Go to the (project folder) Then app -> src -> main. Create folder 'assets -> fonts' into the main folder. Put your 'fontfile.ttf' into the fonts folder.
private Typeface myFont; // A good practice might be to call this in onCreate() of a custom // Application class and pass 'this' as Context. Your font will be ready to use // as long as your app lives public void initFont(Context context) { myFont = Typeface.createFromAsset(context.getAss...
public void setFont(TextView textView) { textView.setTypeface(myFont); }
Grant Vibration Permission before you start implement code, you have to add permission in android manifest : <uses-permission android:name="android.permission.VIBRATE"/> Import Vibration Library import android.os.Vibrator; Get instance of Vibrator from Context Vibrator vibr...
using the vibrate(long[] pattern, int repeat) Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); // Start time delay // Vibrate for 500 milliseconds // Sleep for 1000 milliseconds long[] pattern = {0, 500, 1000}; // 0 meaning is repeat indefinitely vibrator.vib...
You can create vibration patterns by passing in an array of longs, each of which represents a duration in milliseconds. The first number is start time delay. Each array entry then alternates between vibrate, sleep, vibrate, sleep, etc. The following example demonstrates this pattern: vibrate 100...
If you want stop vibrate please call : vibrator.cancel();
using the vibrate(long milliseconds) Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); vibrator.vibrate(500);
Protocol oriented programing can be used as a core Swift design pattern. Different types are able to conform to the same protocol, value types can even conform to multiple protocols and even provide default method implementation. Initially protocols are defined that can represent commonly used pro...
Code source View the output here using System; using System.Diagnostics; using System.IO; using PdfSharp; using PdfSharp.Drawing; using PdfSharp.Pdf; using PdfSharp.Pdf.IO; namespace HelloWorld { /// <summary> /// This sample is the obligatory Hello World program. /// &l...
For one-time, non-constant requests for a user's physical activity, use the Snapshot API: // Remember to initialize your client as described in the Remarks section Awareness.SnapshotApi.getDetectedActivity(client) .setResultCallback(new ResultCallback<DetectedActivityResult>() { ...
// Remember to initialize your client as described in the Remarks section Awareness.SnapshotApi.getHeadphoneState(client) .setResultCallback(new ResultCallback<HeadphoneStateResult>() { @Override public void onResult(@NonNull HeadphoneStateResult headphoneStateResult) {...
// Remember to intialize your client as described in the Remarks section Awareness.SnapshotApi.getLocation(client) .setResultCallback(new ResultCallback<LocationResult>() { @Override public void onResult(@NonNull LocationResult locationResult) { Location lo...

Page 443 of 1336