Jacques Smuts
Android Developer
Nomanini
Section | Estimate |
---|---|
Nomanini/Environment | 2:00 |
Bad Internet | 12:00 |
Unexpected Intermission | 1:00 |
Old Phones | 10:00 |
Theme | 6:00 |
Questions | 8:00 |
informal merchants in Africa
Abidjan, Cote d'Ivoire
Dar Es Salaam, Tanzania
Tanzania, further out
Tanzania, further out
Example Phone
OkHttpClient.Builder()
.connectTimeout(60, TimeUnit.SECONDS)
.writeTimeout(120, TimeUnit.SECONDS)
.readTimeout(120, TimeUnit.SECONDS)
.build()
OkHttpClient.Builder()
.connectTimeout(serverConfig.timeout, TimeUnit.SECONDS)
.writeTimeout(serverConfig.timeout, TimeUnit.SECONDS)
.readTimeout(serverConfig.timeout, TimeUnit.SECONDS)
.build()
class RetryAndFollowUpInterceptor(private val client: OkHttpClient) : Interceptor {
...
companion object {
/**
* How many redirects and auth challenges should we attempt?
*/
private const val MAX_FOLLOW_UPS = ?
}
}
class RetryAndFollowUpInterceptor(private val client: OkHttpClient) : Interceptor {
...
companion object {
/**
* How many redirects and auth challenges should we attempt?
*/
private const val MAX_FOLLOW_UPS = 20
}
}
Running the same operation N times
always gives the same output*
HTTP Method | Idempotent? |
---|---|
GET |
YES |
DELETE | YES |
PUT | YES |
POST | NO |
HTTP Method | Idempotent? |
---|---|
GET | YES |
DELETE | YES |
PUT | YES |
POST | YES |
api.sellAirtime(
userId = "Biko46",
amount = 300,
productId = "MTN123",
)
api.sellAirtime(
userId = "Biko46",
amount = 300,
productId = "MTN123",
sourceReference =
generateSourceReference(
"Biko46",
300,
"MTN123"
)
)
fun generateSourceReference(
userId: String,
amount: Int,
productId: String
) {
val time = System.currentTimeMillis()
return HashUtil.sha1(
"$userId$amount$productId$time"
)
}
Repository
Database
Cloud/Server
UI / Viewmodel
WorkManager,
PushService,
other
Design well, please
developer.android.com recommendations
Following open source contributors on social media
Open Source Projects
Coding personal projects