This file contains 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
{ | |
"context": { | |
"build": { | |
"device": "toco", | |
"fingerprint": "Xiaomi/toco_ru/toco:11/RKQ1.200826.002/V12.5.1.0.RFNRUXM:user/release-keys", | |
"model": "Mi Note 10 Lite", | |
"version": { | |
"sdk": 30 | |
} | |
}, |
This file contains 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
@RunWith(AndroidJUnit4::class) | |
class KotlinSerializationBenchmark { | |
private val context = ApplicationProvider.getApplicationContext<Context>() | |
private val simpleJsonString = Utils.readJsonAsStringFromDisk(context, R.raw.simple) | |
@get:Rule val benchmarkRule = BenchmarkRule() | |
@Before | |
fun init() { |
This file contains 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
private fun measureWorkNs(): Long { | |
// Access a non-trivial amount of data to try and 'reset' any cache state. | |
// Have observed this to give more consistent performance when clocks are unlocked. | |
copySomeData() | |
val state = BenchmarkState() | |
state.performThrottleChecks = false | |
val input = FloatArray(16) { System.nanoTime().toFloat() } | |
val output = FloatArray(16) |
This file contains 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
@Before | |
fun init() { | |
val field = androidx.benchmark.BenchmarkState::class.java.getDeclaredField("REPEAT_COUNT") | |
field.isAccessible = true | |
field.set(benchmarkRule, GLOBAL_REPEAT_COUNT) | |
} |
This file contains 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 onNextIteration(durationNs: Long): Boolean { | |
iteration++ | |
totalDuration += durationNs | |
if (iteration == 1) { | |
fastMovingAvg = durationNs.toFloat() | |
slowMovingAvg = durationNs.toFloat() | |
return false | |
} |
This file contains 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
val startTime = System.currentTimeMillis() | |
//выполняем код который хотим оценить | |
val totalTime = System.currentTimeMillis() - startTime |
This file contains 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
//this is zip function for new standards, if you don't | |
private fun zipFromRaw(rawTextId: Int, resultFileName: String) { | |
val inputStream = context.resources.openRawResource(rawTextId) | |
val stringBuilder = StringBuilder() | |
try { | |
val reader = BufferedReader(InputStreamReader(inputStream)) | |
var line = reader.readLine() | |
while (line != null) { |
This file contains 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
Здравствуйте! | |
Меня порекомендовал Вас Антон | |
Я по поводу разработки приложения на Андроид | |
На данный момент имеется приложение на IOS - Social Gainer | |
Вот само приложение в AppStore: | |
Social Gainer | |
https://appsto.re/ru/eZYeeb.i | |
Нужно написать тоже самое, только под Андроид | |
Приложение взаимодействует с апи сайта (раздел Инстаграм) - socgain.com |
This file contains 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 ManagerContactAdapter extends RecyclerView.Adapter<ManagerContactAdapter.VH>{ | |
private List<Manager> managers = new ArrayList<>(); | |
private OnClickDeleteContactListener listener; | |
public ManagerContactAdapter(OnClickDeleteContactListener listener) { | |
this.listener = listener; | |
} | |
public void setItems(List<Manager> managers){ |
This file contains 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 Observable<List<SomeModel>> loadItems() { | |
return apiService.getListOfElement() | |
.flatMapIterable(Result::getElements) | |
.flatMap(element -> apiService.getDetailedElement(element.getId())) | |
.toList() | |
.toObservable(); | |
} |