Batch file to start applications for ReactNative app development [VSC, Emulator etc]

If you are lazy like me, and wants to automate to start all applications related to ReactNative app development then here are life savior steps for it. This happens when you start your laptop and you have to manually start VisualStudioCode and then go to Android Studio and starts Android AVD manager and then startsContinue reading “Batch file to start applications for ReactNative app development [VSC, Emulator etc]”

Step by step adding Native code to ReactNative apps – Java with JS

For beginning, we will add simple Toast functionalities to react native js code. Prerequisite – You have installed all components like nodejs, Android sdk, react-nativecli. If not please refer to https://facebook.github.io/react-native/docs/getting-started Creating project first Go to your repository folder eg. [react-native-code-base] Type: react-native init NativeModulePackageExampleThis will create ReactNative project with name “NativeModulePackageExample”Inside this there willContinue reading “Step by step adding Native code to ReactNative apps – Java with JS”

Template for Generic Component/Screen – ReactNative

While working on ReactNative applications, I found that most of or all most of the components or screen components were same in format. So if you are beginner then following are the basic and generic template while writing any components/screen. It has 4 parts,1. Imports of other components2. declaration of component with props3. declaration ofContinue reading “Template for Generic Component/Screen – ReactNative”

Single App with multiple root components while learning – React Native Expo

While learning React Native with multiple examples, if you faced an issue that you need to either override the example in root component file e.g. App.js or creating multiple projects for each example. Here, I found another way to have multiple root component files within single project. Expo has entry point details, just like otherContinue reading “Single App with multiple root components while learning – React Native Expo”

My first experience with React Native

Well, I am native developer, almost worked for more than 10 years in Android native development. But, this react native stuff forced me to have a look into it, not professionally but atleast a try.I installed native js and all other stuff as described by https://facebook.github.io/react-native/docs/getting-started. I started first with React native CLI, did allContinue reading “My first experience with React Native”

Androidx Kotlin App – MVVM + Dagger2 + RxJava + Retrofit + Butterknife + Mockito + UnitTest + Robolectric + MockWebServer

Steps:1. Configure gradle with libs dependencies2. Create model classes3. Create repository module4. Create ViewModel for City5. Create DI (dependency injection) module6. Create Unit test7. Create UI8. Update Application, DI modules Let’s start:1. Configure gradle with libs dependencies – 2. Create model classes –I am using Open Weather Map http://api.openweathermap.org/data/2.5/weather?q=London,uk ‘s City weather api to demonstrateContinue reading “Androidx Kotlin App – MVVM + Dagger2 + RxJava + Retrofit + Butterknife + Mockito + UnitTest + Robolectric + MockWebServer”

Unit testing by mocking static method of ActivityCompat – Android for permission

Usually while writing unit tests for our code is easier with mocking the stubs, but when we need to mock the third party code or specially OS classes it becomes very tough or sometimes impossible. One of such class is ActivityCompact which has static functions only. Mocking static function is something not advisable and sometimesContinue reading “Unit testing by mocking static method of ActivityCompat – Android for permission”

Android app supporting 64 bit architecture

These days most of the Android phones are 64 bit, supporting 32 as well as 64 bit apps. 64 bit app gets better opportunity to use 64 bit architecture of phone like, memory, efficiency, fast execution and many more like enhanced security. To learn more please read this blog. Now, how to support 64 bitContinue reading “Android app supporting 64 bit architecture”

Migrating Android app with Fabric to AndroidX

While developing Android app for higher version, we all developers would have supported for backward compatibility for lower versions. We have done that by incorporating support libraries like. final ANDROID_SUPPORT_VER = “27.1.1” implementation ‘com.android.support.constraint:constraint-layout:1.1.0’ implementation ‘com.android.support:multidex:1.0.3’ implementation “com.android.support:support-v4:${ANDROID_SUPPORT_VER}” implementation”com.android.support:customtabs:${ANDROID_SUPPORT_VER}” implementation “com.android.support:design:${ANDROID_SUPPORT_VER}” implementation “com.android.support:cardview-v7:${ANDROID_SUPPORT_VER}” implementation “com.android.support:support-v4:${ANDROID_SUPPORT_VER}” implementation “com.android.support:recyclerview-v7:${ANDROID_SUPPORT_VER}” Now, Android has come up with new thingContinue reading “Migrating Android app with Fabric to AndroidX”

Multi Dex support in Android

Developers who were coding before Android 5.0 Api 21 may have faced the trivial issue of 64K issue ie method call references exceed 65536 references. Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536 This number represents the total number of references that can be invoked by theContinue reading “Multi Dex support in Android”