Tutorial by Examples: api2

A one-liner that helps granting or revoking vulnerable permissions. granting adb shell pm grant <sample.package.id> android.permission.<PERMISSION_NAME> revoking adb shell pm revoke <sample.package.id> android.permission.<PERMISSION_NAME> Granting all run...
<style name="AppTheme" parent="Theme.AppCompat"> <item name="android:colorEdgeEffect">@color/my_color</item> </style>
5.0 The ripple animation is shown when user presses clickable views. You can use the same ripple color used by your app assigning the ?android:colorControlHighlight in your views. You can customize this color by changing the android:colorControlHighlight attribute in your theme: This effect colo...
This attribute can change the background of the Status Bar icons (at the top of the screen) to white. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:windowLightStatusBar">true</item> </style>
5.0 This attribute is used to change the navigation bar (one, that contain Back, Home Recent button). Usually it is black, however it's color can be changed. <style name="AppTheme" parent="Theme.AppCompat"> <item name="android:navigationBarColor">@col...
// Global.asax.cs calls this method at application start public static void Register(HttpConfiguration config) { // New code config.EnableCors(); } //Enabling CORS for controller after the above registration [EnableCors(origins: "http://example.com", headers: "*"...
public static void Register(HttpConfiguration config) { var corsAttr = new EnableCorsAttribute("http://example.com", "*", "*"); config.EnableCors(corsAttr); }
Android 6 (API23) introduced Doze mode which interferes with AlarmManager. It uses certain maintenance windows to handle alarms, so even if you used setExactAndAllowWhileIdle() you cannot make sure that your alarm fires at the desired point of time. You can turn this behavior off for your app using...
What and Why ? Asp.Net’s Web API2 is the latest version of Web API. It is an easy way to implement a RESTful web service using all of the goodness that the Asp.Net framework provides. Once you understand the basic principles of REST, then a Asp.net Web API2 will be very easy to implement. Web API2...
The following server-side configuration allows CORS request to work along with Windows Authentication (no anonymous must be enabled in IIS). web.config - allow unauthenticated (anonymous) preflight requests (OPTIONS) <system.web> <authentication mode="Windows" /> &l...
The following example shows how to properly construct both GET and POST requests against Web API 2 (CORS must be configured server-side, if sent from another domain): <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.js"></script> CORS with Wi...
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script> CORS with Windows Authentication test (Angular) <script type="text/javascript"> var app = angular.module('myApp', []); app.c...

Page 1 of 1