Skip to content

Instantly share code, notes, and snippets.

View BurningDroid's full-sized avatar
💭
I may be slow to respond.

Dev.Aaron BurningDroid

💭
I may be slow to respond.
View GitHub Profile
@BurningDroid
BurningDroid / Flutter Splash_Ripple effect.dart
Created March 26, 2019 14:31
Flutter Splash/Ripple effect
Widget _buildItem(Item item) {
return InkWell(
child: Container(
decoration: BoxDecoration(
border: Border.all(
color: Colors.green,
),
borderRadius: BorderRadius.circular(8),
),
child: Padding(
@BurningDroid
BurningDroid / in-app-updates.kt
Last active May 11, 2019 07:07
Android: in-app updates
val appUpdateManager = AppUpdateManagerFactory.create(this)
appUpdateManager.appUpdateInfo.addOnCompleteListener {
val result = it.result
if (result.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
&& result.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
info("should show update")
appUpdateManager.startUpdateFlowForResult(
result,
AppUpdateType.FLEXIBLE,
@BurningDroid
BurningDroid / javascript_date_time_convert.js
Created June 26, 2019 04:46
[Javascript] DateTime convert
const strDatetime = "2019-06-18T09:21:48Z"
const longDatetime = Date.parse(strDatetime) // 1560849708000
const parsedDatetime = new Date(longDatetime).toString() // Tue Jun 18 2019 18:21:48 GMT+0900 (GMT+09:00)
@BurningDroid
BurningDroid / blog_android_how_to_draw_on_the_bitmap_image.java
Last active October 22, 2019 15:12
[android] how to draw on the bitmap image
Bitmap newImage = Bitmap.createBitmap(bitmap).copy(Config.ARGB_8888, true);
Canvas canvas = new Canvas(newImage);
canvas.drawCircle(100, 100, 50, pnt);
canvas.drawBitmap(bitImage, x, y, pnt);
@BurningDroid
BurningDroid / [Android] startActivityForResult 사용 시 주의할 점 code 1.java
Created October 22, 2019 15:42
[Android] startActivityForResult 사용 시 주의할 점 code 1
static final int PICK_CONTACT_REQUEST = 1; // request code
private void pickContact() {
Intent pickContactIntent = new Intent(Intent.ACTION_PICK, Uri.parse("content://contacts"));
pickContactIntent.setType(Phone.CONTENT_TYPE);
startActivityForResult(pickContactIntent, PICK_CONTACT_REQUEST);
}
@BurningDroid
BurningDroid / [Android] startActivityForResult 사용 시 주의할 점 code 2.java
Created October 22, 2019 15:44
[Android] startActivityForResult 사용 시 주의할 점 code 2
// Create intent to deliver some kind of result data
Intent result = new Intent("com.example.RESULT_ACTION", Uri.parse("content://result_uri"));
setResult(Activity.RESULT_OK, result);
finish();
@BurningDroid
BurningDroid / [Android] startActivityForResult 사용 시 주의할 점 code 3.java
Created October 22, 2019 15:45
[Android] startActivityForResult 사용 시 주의할 점 code 3
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Check which request it is that we're responding to
if (requestCode == PICK_CONTACT_REQUEST) {
// Make sure the request was successful
if (resultCode == RESULT_OK) {
// Get the URI that points to the selected contact
Uri contactUri = data.getData();
// We only need the NUMBER column, because there will be only one row in the result
String[] projection = {Phone.NUMBER};
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test">
...
<uses-permission android:name="android.permission.READ_SMS"/>
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
...
</manifest>
public class SMSReceiver extends BroadcastReceiver {
private static final String TAG = "SMSReceiver";
@Override
public void onReceive(Context context, Intent intent) {
Log.d(TAG, "BroadcastReceiver Received");
if ("android.provider.Telephony.SMS_RECEIVED".equals(intent.getAction())) {
Bundle bundle = intent.getExtras();
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.test">
...
<application
...
<receiver android:name=".sms.SMSReceiver">