This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useTheme } from "@mui/material/styles"; // or @mui/joy/styles | |
import useMediaQuery from "@mui/material/useMediaQuery"; | |
/** | |
* taken from https://material-ui.com/components/use-media-query/#migrating-from-withwidth | |
* | |
* Be careful using this hook. It only works because the number of | |
* breakpoints in theme is static. It will break once you change the number of | |
* breakpoints. See https://reactjs.org/docs/hooks-rules.html#only-call-hooks-at-the-top-level | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1: Integrate the api_sdk as well in app/build.gradle | |
compile ('com.trustvision:tv_api_sdk:1.0.17@aar') { | |
transitive = true | |
} | |
// Step 2: | |
// If the image is in base64, convert it to byte array | |
// use something like below | |
// byte[] decodedString = Base64.decode(base64String, Base64.DEFAULT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Step 1: Integrate the api_sdk as well in app/build.gradle | |
compile ('com.trustvision:tv_api_sdk:1.0.17@aar') { | |
transitive = true | |
} | |
// Step 2: | |
// If the image is in base64, convert it to byte array | |
// use something like below | |
// byte[] decodedString = Base64.decode(base64String, Base64.DEFAULT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a string describing a day relative to the current day. For example if the day is | |
* today this function returns "Today", if the day was a week ago it returns "7 days ago", and | |
* if the day is in 2 weeks it returns "in 14 days". | |
* | |
* @param r the resources | |
* @param day the relative day to describe in UTC milliseconds | |
* @param today the current time in UTC milliseconds | |
*/ | |
private static final String getRelativeDayString(Resources r, long day, long today) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns a string describing 'time' as a time relative to 'now'. | |
* <p> | |
* Time spans in the past are formatted like "42 minutes ago". Time spans in | |
* the future are formatted like "in 42 minutes". | |
* <p> | |
* Can use {@link #FORMAT_ABBREV_RELATIVE} flag to use abbreviated relative | |
* times, like "42 mins ago". | |
* | |
* @param time the time to describe, in milliseconds |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Nullable | |
/** | |
* Converts {@link retrofit.client.Response#body} to simple {@link java.lang.String} representation. | |
* This can be used to log message or manually parse JSON or any other purpose. | |
* @param response | |
* @return | |
*/ | |
public static String toString(@NonNull Response response) { | |
if (response == null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/w3c | |
https://github.com/w3c-webmob |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<target name="launchApp"> | |
<!-- | |
For e.g. adb shell am start -n com.myorg.packagename/com.myorg.activity.package.ActivityName | |
--> | |
<exec executable="adb"> | |
<arg value="shell" /> | |
<arg value="am" /> | |
<arg value="start" /> | |
<arg value="-n" /> | |
<arg value="com.myorg.packagename/com.myorg.activity.package.ActivityName" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For some help with the Utils class, you may want to take a look | |
// at the following android-utils library. | |
// https://github.com/jaydeepw/android-utils | |
private Uri mOutputFileUri; | |
private void openPhotoChooser() { | |
// Determine Uri of camera image to save |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a class member variable. | |
WifiManager.WifiLock mWifiLock = null; | |
/*** | |
* Calling this method will aquire the lock on wifi. This is avoid wifi | |
* from going to sleep as long as <code>releaseWifiLock</code> method is called. | |
**/ | |
private void holdWifiLock() { | |
WifiManager wifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); |
NewerOlder