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://googlesecured.page.link/android_root_article_1 | |
| https://googlesecured.page.link/android_root_article_2 | |
| https://googlesecured.page.link/android_root_article_3 | |
| https://googlesecured.page.link/android_root_article_4 | |
| https://googlesecured.page.link/android_root_article_5 | |
| https://googlesecured.page.link/android_root_article_6 | |
| https://googlesecured.page.link/android_root_article_7 | |
| https://googlesecured.page.link/android_root_article_8 | |
| https://googlesecured.page.link/android_root_article_9 | |
| https://googlesecured.page.link/android_root_article_10 |
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
| // got a new frame from the Android device's camera | |
| doAsync { | |
| // process the frame to get some meaningful data | |
| uiThread { | |
| // show result to the user | |
| // Suppose further processing is required | |
| doAsync { | |
| // process further to get more meaningful data | |
| uiThread { | |
| // show final result to the user |
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 static ArrayList<String> getRandomColorListEqualToDataSize(ArrayList<String> colorList, int dataSize) { | |
| ArrayList<String> randomNewColorList = new ArrayList<String>(); | |
| if (colorList == null || colorList.size() == 0 || dataSize == 0) { | |
| return randomNewColorList; | |
| } | |
| int randomIndex = new Random().nextInt(colorList.size()); | |
| for (int i=0; i<dataSize; i++) { | |
| int index = i + randomIndex; |
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
| dependencies { | |
| implementation 'com.github.mumayank:AirLocation:LATEST_VERSION' // this line | |
| } |
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
| allprojects { | |
| repositories { | |
| ... | |
| maven { url 'https://jitpack.io' } // this line | |
| } | |
| } |
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
| airLocation = AirLocation(this, true, true, object: AirLocation.Callbacks { | |
| override fun onSuccess(location: Location) { | |
| // location fetched successfully, proceed with it | |
| } | |
| override fun onFailed(locationFailedEnum: AirLocation.LocationFailedEnum) { | |
| // couldn't fetch location due to reason available in locationFailedEnum | |
| // you may optionally do something to inform the user, even though the reason may be obvious | |
| } |
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
| override fun onSuccess(location: Location) { | |
| // location fetched successfully, proceed with it | |
| } | |
| override fun onFailed(locationFailedEnum: AirLocation.LocationFailedEnum) { | |
| // couldn't fetch location due to reason available in locationFailedEnum | |
| // you may optionally do something to inform the user, even though the reason may be obvious | |
| } | |
| }) |
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
| class MainActivity : AppCompatActivity() { | |
| private var airLocation: AirLocation? = null // ADD THIS LINE ON TOP | |
| ... | |
| override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | |
| airLocation?.onActivityResult(requestCode, resultCode, data) // ADD THIS LINE INSIDE onActivityResult | |
| super.onActivityResult(requestCode, resultCode, data) | |
| } |
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
| implementation 'com.google.android.gms:play-services-location:16.0.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
| <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> | |
| <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
| <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
| <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |