Skip to content

Instantly share code, notes, and snippets.

View anoopmaddasseri's full-sized avatar
💪
Nothing great ever came that easy.!!

Anoop Maddasseri anoopmaddasseri

💪
Nothing great ever came that easy.!!
View GitHub Profile
@anoopmaddasseri
anoopmaddasseri / Generic StartActivityForResult contract - JAVA
Last active December 5, 2022 22:13
Generic StartActivityForResult contract - JAVA & Kotlin
ActivityResultLauncher<Intent> mStartForResult = registerForActivityResult(new StartActivityForResult(),
new ActivityResultCallback<ActivityResult>() {
@Override
public void onActivityResult(ActivityResult result) {
if (result.getResultCode() == Activity.RESULT_OK) {
Intent intent = result.getIntent();
// Handle the Intent
}
}
});
val getContent = registerForActivityResult(GetContent()) { uri: Uri? ->
// Handle the returned Uri
}
override fun onCreate(savedInstanceState: Bundle?) {
// ...
val selectButton = findViewById<Button>(R.id.select_button)
selectButton.setOnClickListener {
@anoopmaddasseri
anoopmaddasseri / Places Autocomplete Picker
Last active July 3, 2019 09:32
Places autocomplete picker helper using the new Places SDK client
package xxx.xxx.xxx
/*
* @author Anoop M <anoopmaddasseri@gmail.com>
* @version 1
* @since 03 July 2019
*
*/
import android.app.Activity
@anoopmaddasseri
anoopmaddasseri / react_vs_ionic2.csv
Last active October 24, 2017 10:31
React Native vs Ionic 2 framework: Side-by-Side Comparison
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 5.
ELEMENT,REACT NATIVE,IONIC 2
Powered By,"Based on React backed on Facebook","Based on Angular 2 backed by Google"
The Language stack,"React Native is based on the Javascript framework React and, thus, uses Javascript code that resembles HTML but essentially isn’t—they call it. JSX( is a preprocessor step that adds XML syntax to JavaScript). With that, the display logic is blended in with the business logic.","HTML5, SASS, Angularjs , Cordova & TypeScript( A strict syntactical superset of JavaScript ). Ionic is a framework based on Angularjs, a Javascript framework. It uses HTML templates for its views. It is in line with the Model-View-Controller pattern as views and logic are clearly separated."
Boot up time,"Boot up time is as fast as native apps","Boot up time is as fast as native apps"
Memory Usage,"When it comes to memory usage, Ionic framework uses more than react native apps. can feel a little clunky but this can be mitigated with good design practises.","React native is a memory saver as it supports t