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 Clothes { | |
| public Money mMoney; | |
| @Inject | |
| public Clothes(Money money) { | |
| this.mMoney = money; | |
| if (mMoney != null) { | |
| System.out.println("I've Clothes to wear!"); |
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
| package life; | |
| import javax.inject.Inject; | |
| public class Education { | |
| @Inject | |
| public Education() { | |
| System.out.println("I'm Well Educated!"); | |
| } |
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
| package com.shreyaspatil.callbackflownetwork | |
| import android.content.Context | |
| import android.net.ConnectivityManager | |
| import android.net.Network | |
| import android.net.NetworkCapabilities | |
| import android.net.NetworkRequest | |
| import kotlinx.coroutines.ExperimentalCoroutinesApi | |
| import kotlinx.coroutines.channels.awaitClose | |
| import kotlinx.coroutines.flow.MutableStateFlow |
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
| function doPost(request){ | |
| // Open Google Sheet using ID | |
| var sheet = SpreadsheetApp.openById("1OOArrqjOqmD4GiJOWlluZ4woTMH_qaV6RKv4JXnT3Hk"); | |
| var result = {"status": "SUCCESS"}; | |
| try{ | |
| // Get all Parameters | |
| var name = request.parameter.name; | |
| var email = request.parameter.email; | |
| var mobileNo = request.parameter.mobileNo; | |
| var feedback = request.parameter.feedback; |
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 { | |
| //RecyclerView | |
| implementation 'com.android.support:recyclerview-v7:28.0.0' | |
| //Firebase Database | |
| implementation 'com.google.firebase:firebase-database:16.1.0' | |
| implementation 'com.google.firebase:firebase-core:16.0.7' | |
| //Firebase-UI Library |
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
| package com.shreyaspatil.callbackflownetwork | |
| import android.content.Context | |
| import android.net.ConnectivityManager | |
| import android.net.Network | |
| import android.net.NetworkCapabilities | |
| import android.net.NetworkRequest | |
| import kotlinx.coroutines.ExperimentalCoroutinesApi | |
| import kotlinx.coroutines.channels.awaitClose | |
| import kotlinx.coroutines.flow.MutableStateFlow |
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
| fun getCellInfo(info: CellInfoGsm): CellInfo { | |
| val cellInfo = CellInfo() | |
| cellInfo.radio = RadioType.GSM | |
| info.cellIdentity.let { | |
| val (mcc, mnc) = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { | |
| Pair(it.mccString?.toInt() ?: 0, it.mncString?.toInt() ?: 0) | |
| } else { | |
| Pair(it.mcc, it.mnc) | |
| } |
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
| fun getCurrentCellInfo(context: Context): List<CellInfo> { | |
| val telephonyManager = context.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager | |
| val allCellInfo = telephonyManager.allCellInfo | |
| return allCellInfo.mapNotNull { | |
| when (it) { | |
| is CellInfoGsm -> getCellInfo(it) | |
| is CellInfoWcdma -> getCellInfo(it) | |
| is CellInfoLte -> getCellInfo(it) | |
| else -> null |
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
| interface UnwiredLabsService { | |
| @POST("v2/process.php") | |
| suspend fun getLocationByCellInfo(@Body cellInfo: CellInfo): Response<CellLocation> | |
| companion object { | |
| const val BASE_URL = "https://ap1.unwiredlabs.com/" | |
| } | |
| } |
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
| data class CellLocation( | |
| val status: String, | |
| val message: String?, | |
| val accuracy: Int? = null, | |
| val address: String? = null, | |
| @Json(name = "lat") | |
| val latitude: Double? = null, | |
| @Json(name = "lon") |
NewerOlder