This file contains 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
1.Run in the terminal - adb tcpip 5555 | |
2.Run in the terminal - adb connect <IP>:5555 | |
* First step only needed if device was restarted. | |
* To disconnect WiFi connection run step 2 but with disconnect keyword instead. | |
* IP - can be found in the WiFi setting of the device. |
This file contains 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
private void uploadShotToFirebase() { | |
final String path = "UserImages/" + UUID.randomUUID() + ".png"; | |
StorageReference imagesRef = mFirebaseStorage.getReference(path); | |
StorageMetadata imageMetaData = new StorageMetadata.Builder().setCustomMetadata("text2", "some metadata2").build(); | |
//show progress circle, disable upload button | |
UploadTask uploadTask = imagesRef.putBytes(bitmapInByteArray, imageMetaData); | |
uploadTask.addOnSuccessListener(getActivity(),new OnSuccessListener<UploadTask.TaskSnapshot>() { | |
@Override |
This file contains 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
<LinearLayout | |
android:weightSum="60" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical"> | |
<LinearLayout | |
android:layout_weight="20" | |
android:layout_width="match_parent" |
This file contains 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
private void generateHash() { | |
try { | |
PackageInfo info = getPackageManager().getPackageInfo( | |
BuildConfig.APPLICATION_ID,// change to the main package name!! | |
PackageManager.GET_SIGNATURES); | |
for (Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); | |
} |
This file contains 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
public class MainClass { | |
public static void main(String[] args) { | |
//randomEx(); | |
//consequentialOddSum(); | |
//arry1DQ1(); | |
//arry1DQ4(); |
This file contains 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
package com.example.test.models; | |
import com.google.gson.annotations.SerializedName; | |
import java.io.Serializable; | |
public class SomeModel{ | |
@SerializedName("search_results") //The exact string that will be in the parsed JSON | |
private SearchResults searchResults;//We see that the parsed item is an object and not a simple variable, another Model with the name "SearchResults" is created with the same procedure as in this document |