Condition | Result |
---|---|
"test" is String | true |
"test" is String? | true |
null is String | false |
null is String? | true |
"test" as String | ok |
"test" as String? | ok |
123 as String | throw |
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
task uploadFirebaseMapping { | |
def configPath = rootProject.rootDir.absolutePath; | |
switch (project.findProperty('variant')) { | |
case 'frog': | |
setProperty('FirebaseServiceAccountFilePath', configPath + getProperty('firebase.crash.frog')) | |
uploadFirebaseMapping.dependsOn('firebaseUploadFrogProguardMapping') | |
break | |
case 'smartearly': | |
setProperty('FirebaseServiceAccountFilePath', configPath + getProperty('firebase.crash.smartearly')) |
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 openGallery() { | |
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); | |
intent.setType("image/*"); | |
startActivityForResult(Intent.createChooser(intent, "Select Photo"), REQUEST_GALLERY); | |
} | |
@Override | |
protected void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); |
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
@PerActivity | |
class AccountPresenter @Inject constructor(val authData: AuthData, | |
val devicesData: DevicesData) : MvpPresenter<AccountView>() { | |
fun onStart() { | |
view.setUserName(authData.session().currentUser?.fullName) | |
view.setUserPhoto(authData.session().currentUser?.photoUrl) | |
} | |
fun onEditProfileClick() { |
Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell
and then run-as com.mypackage
( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs
),
but on a production release app downloaded from an app store you're most likely to see:
run-as: Package 'com.mypackage' is not debuggable
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
import android.content.Intent; | |
import android.os.Handler; | |
import android.os.Looper; | |
import com.amazon.device.messaging.ADMConstants; | |
import com.amazon.device.messaging.ADMMessageHandlerBase; | |
import javax.inject.Inject; | |
OlderNewer