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
| import android.content.Context | |
| import org.kaaproject.kaa.client.AndroidKaaPlatformContext | |
| import org.kaaproject.kaa.client.BaseKaaClient | |
| import org.kaaproject.kaa.client.logging.memory.MemLogStorage | |
| import org.kaaproject.kaa.client.logging.strategies.RecordCountLogUploadStrategy | |
| /* | |
| * Implementation of In-Memory log storage with enlarged allocated space. | |
| */ | |
| class LargeMemLogStorage : MemLogStorage(MAX_STORAGE_SIZE_BYTES, MAX_BUCKET_SIZE_BYTES, MAX_BUCKET_RECORD_COUNT) { |
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 View.hide() { | |
| visibility = View.INVISIBLE | |
| } | |
| /* Now you can call the newly created method like this: */ | |
| val textView = TextView(context) | |
| textView.hide() |
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
| db.query(TABLE_NAME, columns, query, null, null, null, null, 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
| fun create(credentials: Credentials, | |
| channel: CommunicationChannel = SecuredCommunicationChannel(), | |
| loggingStrategy: LoggingStrategy = DefaultLoggingStrategy(), | |
| host: String = Environment.PRODUCTION_HOST): Proxy { | |
| ... | |
| } | |
| /* This method could be called like this: */ |
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 SecuredCommunicationChannel { | |
| private static volatile SecuredCommunicationChannel instance; | |
| public static SecuredCommunicationChannel getInstance() { | |
| if (instance == null) { | |
| synchronized (SecuredCommunicationChannel.class) { | |
| if (instance == null) { | |
| instance = new SecuredCommunicationChannel(); | |
| } |
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
| object SecuredCommunicationChannel { | |
| fun getChannelDescription(): String { | |
| ... | |
| } | |
| } |
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
| val desc = SecuredCommunicationChannel.getChannelDescription() |
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 inline fun CharSequence?.isNullOrEmpty(): Boolean { | |
| ... | |
| } | |
| public inline fun String?.orEmpty(): String { | |
| ... | |
| } | |
| public val CharSequence.indices: IntRange { | |
| ... |
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 CommunicationChannel { | |
| fun connect(credentials: Credentials) | |
| fun disconnect() | |
| fun getChannelDescription(): Description | |
| } | |
| data class Credentials(val secret: String, val key: String) | |
| data class Description( | |
| val numberOfPeers: Int, |
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 UserService { | |
| Single<UserProfile> getUserProfile(); | |
| Single<FinancialDetails> getFinancialDetails(); | |
| Completable finalizeOnboarding(); | |
| } |
OlderNewer