- Learn how to start a new react native project
- Run it on ios simulator, on android emulator, on a real iPhone device and on a real Android device, with and without debugging enabled.
- Learn how to upgrade a react native project
- Learn how to add a package to the project
- Learn how to add a package that has a native dependency (https://github.com/airbnb/react-native-maps, https://github.com/evollu/react-native-fcm) - DO NOT USE COCOAPODS
- Learn how to use fetch to get data from your backend
This file contains hidden or 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
| // passing to intent: | |
| b.putSerializable(BUNDLE_PARAMS, new Gson().toJson(params)); | |
| // retrieving data: | |
| List<KeyValueStringPair> params = new Gson().fromJson(b.getString(BUNDLE_PARAMS), new TypeToken<List<KeyValueStringPair>>(){}.getType()) | |
| // model class | |
| public static class KeyValueStringPair implements Serializable { | |
| @SerializedName("_key") |
This file contains hidden or 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
| # Built application files | |
| *.apk | |
| *.ap_ | |
| # Files for the ART/Dalvik VM | |
| *.dex | |
| # Java class files | |
| *.class |
This file contains hidden or 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
| // add double spaces | |
| public String addSpacesBetweenChar(String str) { | |
| if (!str.contains("*")) { | |
| str = "******" + str; | |
| } | |
| return str.replaceAll(".(?=.)", "$0 "); | |
| } |
This file contains hidden or 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
| final LinearLayout layout = (LinearLayout) findViewById(R.id.YOUR_VIEW_ID); | |
| ViewTreeObserver vto = layout.getViewTreeObserver(); | |
| vto.addOnGlobalLayoutListener (new OnGlobalLayoutListener() { | |
| @Override | |
| public void onGlobalLayout() { | |
| layout.getViewTreeObserver().removeOnGlobalLayoutListener(this); | |
| int width = layout.getMeasuredWidth(); | |
| int height = layout.getMeasuredHeight(); | |
| } |
This file contains hidden or 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 MyProgressDialog extends ProgressDialog { | |
| private TextView mTvMessage; | |
| private Context mContext; | |
| public VedProgressDialog(Context context) { | |
| super(context); | |
| mContext = context; | |
| setIndeterminate(true); | |
| setCancelable(false); |
This file contains hidden or 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
| // https://corbt.com/posts/2015/09/18/mixing-32-and-64bit-dependencies-in-android.html | |
| android { | |
| ... | |
| defaultConfig { | |
| ... | |
| ndk { | |
| abiFilters "armeabi-v7a", "x86" | |
| } |
This file contains hidden or 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
| <html> | |
| <body> | |
| <h2>Privacy Policy</h2> | |
| <p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended | |
| for use as is.</p> | |
| <p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and | |
| disclosure of Personal Information if anyone decided to use [my|our] Service.</p> | |
| <p>If you choose to use [my|our] Service, then you agree to the collection and use of information in | |
| relation with this policy. The Personal Information that [I|we] collect are used for providing and | |
| improving the Service. [I|We] will not use or share your information with anyone except as described |
This file contains hidden or 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
| <html> | |
| <body> | |
| <h2>Privacy Policy</h2> | |
| <p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended | |
| for use as is.</p> | |
| <p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and | |
| disclosure of Personal Information if anyone decided to use [my|our] Service.</p> | |
| <p>If you choose to use [my|our] Service, then you agree to the collection and use of information in | |
| relation with this policy. The Personal Information that [I|we] collect are used for providing and | |
| improving the Service. [I|We] will not use or share your information with anyone except as described |