├── .gitignore ├── .idea ├── .name ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── libraries │ ├── animated_vector_drawable_24_2_1.xml │ ├── appcompat_v7_24_2_1.xml │ ├── design_24_2_1.xml │ ├── firebase_analytics_9_0_0.xml │ ├── firebase_analytics_impl_9_0_0.xml │ ├── firebase_client_android_2_4_0.xml │ ├── firebase_client_jvm_2_4_0.xml │ ├── firebase_common_9_0_0.xml │ ├── firebase_core_9_0_0.xml │ ├── firebase_iid_9_0_0.xml │ ├── jackson_annotations_2_2_2.xml │ ├── jackson_core_2_2_2.xml │ ├── jackson_databind_2_2_2.xml │ ├── libphonenumber_android_8_1_0.xml │ ├── play_services_base_9_0_0.xml │ ├── play_services_basement_9_0_0.xml │ ├── play_services_tasks_9_0_0.xml │ ├── recyclerview_v7_24_2_1.xml │ ├── support_annotations_24_2_1.xml │ ├── support_compat_24_2_1.xml │ ├── support_core_ui_24_2_1.xml │ ├── support_core_utils_24_2_1.xml │ ├── support_fragment_24_2_1.xml │ ├── support_media_compat_24_2_1.xml │ ├── support_v4_24_2_1.xml │ ├── support_vector_drawable_24_2_1.xml │ └── tubesock_0_0_12.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml ├── vcs.xml └── workspace.xml ├── README.md ├── app ├── .gitignore ├── app.iml ├── build.gradle ├── google-services.json ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── clearbits │ │ └── bitcricket │ │ └── android │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── sampleapp │ │ │ └── android │ │ │ ├── MainActivity.java │ │ │ └── MyApplication.java │ └── res │ │ ├── layout │ │ ├── activity_main.xml │ │ └── content_main.xml │ │ ├── menu │ │ └── menu_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── clearbits │ └── bitcricket │ └── android │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── settings.gradle └── utilsplus ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── src ├── androidTest │ └── java │ │ └── com │ │ └── github │ │ └── rrsystems │ │ └── utilsplus │ │ └── android │ │ └── ApplicationTest.java ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── rrsystems │ │ │ └── utilsplus │ │ │ └── android │ │ │ ├── SMSReceiver.java │ │ │ └── UtilsPlus.java │ └── res │ │ └── values │ │ └── strings.xml └── test │ └── java │ └── com │ └── github │ └── rrsystems │ └── utilsplus │ └── android │ └── ExampleUnitTest.java └── utilsplus.iml /.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | Bit Cricket -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/libraries/animated_vector_drawable_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/appcompat_v7_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/design_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_analytics_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_analytics_impl_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_client_android_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_client_jvm_2_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_common_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_core_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/firebase_iid_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/jackson_annotations_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/jackson_core_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/jackson_databind_2_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/libphonenumber_android_8_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/play_services_base_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/play_services_basement_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/play_services_tasks_9_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/recyclerview_v7_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/libraries/support_annotations_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/support_compat_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_core_ui_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_core_utils_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/support_fragment_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_media_compat_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/support_v4_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/support_vector_drawable_24_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/tubesock_0_0_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UtilsPlus 2 | Android utility library which contains usefull utility classes with simple reusable methods. 3 | 4 | ## Adding to your project: 5 | To start using this library, add these lines to the build.gradle of your project: 6 | ``` 7 | compile 'com.github.rrsystems:utilsplus:1.1.0' 8 | ``` 9 | 10 | ### Initialize the libray in your application class 11 | ``` 12 | UtilsPlus.initialize(getApplicationContext()); 13 | ``` 14 | if you want to define name of your shared preference, intialize like below 15 | ``` 16 | UtilsPlus.initialize(getApplicationContext(), "my_preference_name"); 17 | ``` 18 | ### To toast a message, simply insert this line. 19 | First parameter specifies message to be shown and second parameter specifies toast time in seconds 20 | ``` 21 | UtilsPlus.getInstance().toast("Hello World!", 5); 22 | ``` 23 | ### How to copy a text to clipboard? 24 | ``` 25 | UtilsPlus.getInstance().copyToClipboard("text to be copied"); 26 | ``` 27 | 28 | ### How to check there is an internet connection or not? 29 | ``` 30 | if (UtilsPlus.getInstance().checkNetworkState()){ 31 | Log.d("utils plus","internet connection"); 32 | } 33 | else { 34 | Log.d("utils plus","no internet connection"); 35 | } 36 | ``` 37 | ### How to check whether the string is a valid email id or not? 38 | ``` 39 | UtilsPlus.getInstance().checkEmailIsValid("rakshithsj30@gmail.com"); 40 | ``` 41 | ### How to check whether the string is a valid phone number or not? 42 | ``` 43 | // second parameter is country code 44 | UtilsPlus.getInstance().validatePhoneNumber("9480523270","91"); 45 | ``` 46 | ### How to generate a random string? 47 | ``` 48 | UtilsPlus.getInstance().getRandomString(); 49 | ``` 50 | 51 | ### How to display a simple push notification? 52 | ``` 53 | /* 54 | * Utility method which will help you to show notification in the status bar. 55 | * @param title title of the push notification 56 | * @param body content to be displayed in the notification 57 | * @param small_icon small icon which will be showed in the notification. should be of following format:R.drawable.imageName 58 | * @param large_icon Large icon which will be showed in the notification. should be of following format:R.drawable.imageName 59 | * @param class_name The activity which will open on clicking notification. Parameter format: activity_name.class 60 | * @param autoCancel true or false. if set to true, notification will be disappeared after clicking it otherwise it will remain in the status bar 61 | */ 62 | 63 | 64 | UtilsPlus.getInstance().displaySimplePushNotification("New Mesage","new message received",R.drawable.photo,R.drawable.photo,MainActivity.class,true); 65 | 66 | ``` 67 | ### How to send an email using email clients installed in the device? 68 | ``` 69 | UtilsPlus.getInstance().sendEmail("Intent chooser title", "Email title", "Email body", "recipient1@xyz.com", "recipient2@abc.com"); 70 | ``` 71 | ### How to encypt and decrypt a string? 72 | encrypting a string: 73 | ``` 74 | UtilsPlus.getInstance().encryptIt("secret key", "string to be encrypted"); 75 | 76 | ``` 77 | decrypting a string: 78 | ``` 79 | UtilsPlus.getInstance().decryptIt("secret key", "string to be decrypted"); 80 | ``` 81 | ### How to get IMEI Code of the device? 82 | To make this code work, you need to specify relevant permissions in android manifest. For mashmallow and above, user has to grant permissions. 83 | ``` 84 | UtilsPlus.getInstance().getIMEICode(); 85 | ``` 86 | ### How to get device id of the device? 87 | To make this code work, you need to specify relevant permissions in android manifest. For mashmallow and above, user has to grant permissions. 88 | ``` 89 | UtilsPlus.getInstance().getDeviceID(); 90 | ``` 91 | ### How to check whether a service created by your app is running or not? 92 | ``` 93 | UtilsPlus.getInstance().checkServiceIsRunning(service1.class); 94 | ``` 95 | 96 | ### How to convert drawable image into bitmap? 97 | ``` 98 | UtilsPlus.getInstance().drawableToBitmap(drawable); 99 | ``` 100 | 101 | ### How to use shared preference? 102 | 103 | Save using string as a key 104 | ``` 105 | UtilsPlus.getInstance().put("my_key", "some value"); 106 | UtilsPlus.getInstance().put("my_key", 10); 107 | UtilsPlus.getInstance().put("my_key", true); 108 | ``` 109 | Retriveing the value using key 110 | ``` 111 | UtilsPlus.getInstance().getString("key", "default"); 112 | UtilsPlus.getInstance().getInt("key", 0); 113 | UtilsPlus.getInstance().getBoolean("key", false); 114 | ``` 115 | Removing a preference using key 116 | ``` 117 | UtilsPlus.getInstance().removeKey("key"); 118 | ``` 119 | Clearing shared preference 120 | ``` 121 | UtilsPlus.getInstance().clear(); 122 | ``` 123 | 124 | ### Saving an image to internal storage 125 | 126 | 127 | bitmap --> image in the form of bitmap
128 | image_name --> name of the image
129 | format --> either png or jpg
130 | image path --> path in which image to be stored
131 | quality --> quality of the image
132 | 133 | this method returns absolute path of the saved image. 134 | 135 | ``` 136 | String path = UtilsPlus.getInstance().SaveImage(bitmap, "image_name", "png", "path/in/which/image/to/be/stored", 20,false); 137 | 138 | 139 | ``` 140 | 141 | ### Code Verifier 142 | Copy verification code from SMS automatically. 143 | 144 | Activity class should implement SMSReceiver.SMSListener. 145 | 146 | For example, 147 | ``` 148 | public class MainActivity extends AppCompatActivity implements SMSReceiver.SMSListener { 149 | 150 | ................ 151 | ................. 152 | 153 | } 154 | ``` 155 | 156 | Create Broadcast Receiver like this 157 | ``` 158 | 159 | SMSReceiver smsReceiver = new SMSReceiver(); 160 | 161 | ``` 162 | OnResume method of activty class add this line 163 | 164 | ``` 165 | smsReceiver.registerReceiver(this, smsReceiver, "TM-bytwoo", "9480523270","specify 3rd phone number here"); 166 | smsReceiver.setSMSListener(this); 167 | ``` 168 | 169 | Using onSMSReceived(....) method, parse the verification code 170 | 171 | for example, if you want to parse verification code from this sms, "201232 is your One Time Password" then we should write this code 172 | 173 | ``` 174 | @Override 175 | public void onSMSReceived(String phone_no, String message) { 176 | 177 | // 1st parameter ---> message 178 | // second parameter ---> position of first character of the OTP 179 | // second parameter ---> position of character after last character (includes white space) of OTP 180 | 181 | Strng OTP = smsReceiver.extractCode(message, 0, -999); 182 | 183 | } 184 | 185 | ``` 186 | 187 | Unregister BroadCast Receiver in your activities OnPause() method. 188 | 189 | ``` 190 | @Override 191 | protected void onPause() { 192 | super.onPause(); 193 | if (smsReceiver!=null) { 194 | smsReceiver.unregisterReceiver(this, smsReceiver); 195 | } 196 | 197 | } 198 | 199 | ``` 200 | 201 | 202 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | packagingOptions { 5 | exclude 'META-INF/DEPENDENCIES.txt' 6 | exclude 'META-INF/LICENSE.txt' 7 | exclude 'META-INF/NOTICE.txt' 8 | exclude 'META-INF/NOTICE' 9 | exclude 'META-INF/LICENSE' 10 | exclude 'META-INF/DEPENDENCIES' 11 | exclude 'META-INF/notice.txt' 12 | exclude 'META-INF/license.txt' 13 | exclude 'META-INF/dependencies.txt' 14 | exclude 'META-INF/LGPL2.1' 15 | } 16 | compileSdkVersion 24 17 | buildToolsVersion "23.0.3" 18 | 19 | defaultConfig { 20 | applicationId "com.sampleapp.android" 21 | minSdkVersion 15 22 | targetSdkVersion 24 23 | versionCode 1 24 | versionName "1.0" 25 | } 26 | buildTypes { 27 | release { 28 | minifyEnabled false 29 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 30 | } 31 | } 32 | } 33 | 34 | dependencies { 35 | compile fileTree(dir: 'libs', include: ['*.jar']) 36 | testCompile 'junit:junit:4.12' 37 | compile 'com.android.support:appcompat-v7:24.2.1' 38 | compile 'com.android.support:design:24.2.1' 39 | compile 'com.firebase:firebase-client-android:2.4.0' 40 | compile project(':utilsplus') 41 | 42 | 43 | } 44 | apply plugin: 'com.google.gms.google-services' -------------------------------------------------------------------------------- /app/google-services.json: -------------------------------------------------------------------------------- 1 | { 2 | "project_info": { 3 | "project_number": "979459244103", 4 | "firebase_url": "https://bit-cricket.firebaseio.com", 5 | "project_id": "bit-cricket", 6 | "storage_bucket": "bit-cricket.appspot.com" 7 | }, 8 | "client": [ 9 | { 10 | "client_info": { 11 | "mobilesdk_app_id": "1:979459244103:android:7ada952a65e57099", 12 | "android_client_info": { 13 | "package_name": "com.sampleapp.android" 14 | } 15 | }, 16 | "oauth_client": [ 17 | { 18 | "client_id": "979459244103-oo5e242bdnpo1l1e3mhp9idb77cvshl7.apps.googleusercontent.com", 19 | "client_type": 3 20 | } 21 | ], 22 | "api_key": [ 23 | { 24 | "current_key": "AIzaSyA2wW8Yu0FfFt4jIT4gTWqCzUYI9YsyimA" 25 | } 26 | ], 27 | "services": { 28 | "analytics_service": { 29 | "status": 1 30 | }, 31 | "appinvite_service": { 32 | "status": 1, 33 | "other_platform_oauth_client": [] 34 | }, 35 | "ads_service": { 36 | "status": 2 37 | } 38 | } 39 | } 40 | ], 41 | "configuration_version": "1" 42 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in F:\Android SDK\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/clearbits/bitcricket/android/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.sampleapp.android; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/sampleapp/android/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.sampleapp.android; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.drawable.BitmapDrawable; 5 | import android.os.Bundle; 6 | import android.support.design.widget.FloatingActionButton; 7 | import android.support.design.widget.Snackbar; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.support.v7.widget.Toolbar; 10 | import android.view.Menu; 11 | import android.view.MenuItem; 12 | import android.view.View; 13 | import android.widget.Button; 14 | import java.io.IOException; 15 | import java.util.Iterator; 16 | import java.util.Map; 17 | 18 | import com.sampleapp.android.R; 19 | 20 | 21 | public class MainActivity extends AppCompatActivity { 22 | 23 | 24 | 25 | @Override 26 | protected void onCreate(Bundle savedInstanceState) { 27 | super.onCreate(savedInstanceState); 28 | setContentView(R.layout.activity_main); 29 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 30 | setSupportActionBar(toolbar); 31 | 32 | 33 | 34 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); 35 | 36 | 37 | 38 | 39 | fab.setOnClickListener(new View.OnClickListener() { 40 | @Override 41 | public void onClick(View view) { 42 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) 43 | .setAction("Action", null).show(); 44 | } 45 | }); 46 | 47 | 48 | 49 | } 50 | 51 | @Override 52 | public boolean onCreateOptionsMenu(Menu menu) { 53 | // Inflate the menu; this adds items to the action bar if it is present. 54 | getMenuInflater().inflate(R.menu.menu_main, menu); 55 | return true; 56 | } 57 | 58 | @Override 59 | public boolean onOptionsItemSelected(MenuItem item) { 60 | // Handle action bar item clicks here. The action bar will 61 | // automatically handle clicks on the Home/Up button, so long 62 | // as you specify a parent activity in AndroidManifest.xml. 63 | int id = item.getItemId(); 64 | 65 | //noinspection SimplifiableIfStatement 66 | if (id == R.id.action_settings) { 67 | return true; 68 | } 69 | 70 | return super.onOptionsItemSelected(item); 71 | } 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | } -------------------------------------------------------------------------------- /app/src/main/java/com/sampleapp/android/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.sampleapp.android; 2 | 3 | import android.app.Application; 4 | import android.content.res.Configuration; 5 | 6 | import com.github.rrsystems.utilsplus.android.UtilsPlus; 7 | 8 | /** 9 | * Created by Clear Bits on 4/21/2017. 10 | */ 11 | public class MyApplication extends Application { 12 | 13 | @Override 14 | public void onConfigurationChanged(Configuration newConfig) { 15 | super.onConfigurationChanged(newConfig); 16 | } 17 | 18 | @Override 19 | public void onCreate() { 20 | super.onCreate(); 21 | UtilsPlus.initialize(getApplicationContext(), "myapp"); 22 | } 23 | 24 | @Override 25 | public void onLowMemory() { 26 | super.onLowMemory(); 27 | } 28 | 29 | @Override 30 | public void onTerminate() { 31 | super.onTerminate(); 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithsj30/UtilsPlus/54e8e88bf1aef669fa7a30abc398e69475e1eb83/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithsj30/UtilsPlus/54e8e88bf1aef669fa7a30abc398e69475e1eb83/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithsj30/UtilsPlus/54e8e88bf1aef669fa7a30abc398e69475e1eb83/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithsj30/UtilsPlus/54e8e88bf1aef669fa7a30abc398e69475e1eb83/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshithsj30/UtilsPlus/54e8e88bf1aef669fa7a30abc398e69475e1eb83/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | > 2 | 3 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Bit Cricket 3 | Settings 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |