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
defaultConfig { | |
applicationId = "com.uxstate.instantscore" | |
minSdk = 21 | |
targetSdk = 33 | |
versionCode = 1 | |
versionName = "1.0" | |
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | |
vectorDrawables { | |
useSupportLibrary = true |
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
/*sending local broadcast*/ | |
Intent broadcastIntent = new Intent("custom-intent"); | |
LocalBroadcastManager.getInstance(context).sendBroadcast(broadcastIntent); |
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
/*inflating xml layout*/ | |
LayoutInflater layoutInflater = LayoutInflater.from(MainActivity.this); | |
layoutInflater.inflate(R.layout.activity_main,parent, false); |
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
/*creating a dynamic textview*/ | |
TextView textView = new TextView(MainActivity.this); |
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
File file = new File(context.getFilesDir(), filename); |
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
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
/*getting a notification service*/ | |
NotificationManager notificationManager = (NotificationManager) getSystemService(Context | |
.NOTIFICATION_SERVICE); | |
} |
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 MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
/*this references to the activity's class*/ | |
String [] animal = this.getResources().getStringArray(R.array.animals); | |
} | |
} |
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
/*provide context if MyActivity is a local activity*/ | |
Intent intent = new Intent(context,MyActivity.class); | |
startActivity(intent); |
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
-assumenosideeffects class android.util.Log{ | |
public static boolean isLoggable(java.lang.String, int); | |
public static int v(...); | |
public static int i(...); | |
public static int w(...); | |
public static int d(...); | |
public static int e(...); | |
} |
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
buildTypes { | |
release { | |
postprocessing { | |
removeUnusedCode true | |
removeUnusedResources true | |
obfuscate true | |
optimizeCode true | |
proguardFile 'proguard-rules.pro' | |
} | |
} |
NewerOlder