Android java sdk reference

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

SDK for Java and Android applications

License

Kinvey/android-sdk

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Kinvey is a high-productivity serverless application development platform that provides developers tools to build robust, multi-channel applications utilizing a cloud backend and front-end SDKs. As a platform, Kinvey provides many solutions to common development needs, such as a data store, data integration, single sign-on integration, and file storage. With Kinvey, developers can focus on building what provides value for their app — the user experience (UX) and business logic of the application. This approach increases developer productivity and aims to enable higher quality apps by leveraging Kinvey’s pre-built components.

The Kinvey Android SDK repository represents the package that can be used to develop Android apps on the Kinvey platform. The Kinvey SDK is developed using a mix of Kotlin and Java code, with a gradual transition being made to a completely Kotlin codebase.

The following is a high-level overview of the most important projects in the solution:

  • java-api-core The core of the library. Most of the library functionality is written here. This project contains most of the underlying networking, user management, caching logic. Things that are Android-platform specific are represented as interfaces / abstract classes, and implemented in the android-lib library described below.
  • android-lib : The wrapper library for Android, built on top of java-api-core . All the Android-specific implementation is located here, and most of the classes in this library extend from the ones in java-api-core .

Refer to the Kinvey DevCenter for guides and documentation on using Kinvey.

Versioning of the Kinvey SDK follows the guidelines stated in Semantic Version 2.0.0.

Читайте также:  Java stream удаление элемента

In order to build this repository, the following pre-requisites must be in place:

Once these are set, you can run the following commands:

After performing these commands, a .zip file with generated .aar and .jar files should be in the /release/zipped diretory.

./gradlew test jacocoTestReport 
  • Connect android device or start emulator with min SDK version 15
  • Add app.key and app.secret to android-lib/src/androidTest/assets/kinvey.properties
  • Create User with username: test password: test in your console app
  • Custom endpoints tests and Social networks tests should be configured additionally
./gradlew connectedAndroidTest --info 

Documentation for using the Kinvey SDK as well as other parts of the Kinvey platform can be found in the Kinvey DevCenter reference guide.

Feedback on our SDK is welcome and encouraged. Please, use GitHub Issues on this repository for reporting a bug or requesting a feature for this SDK. Please reference our contribution guide for more information.

We would also love to have your contributions! You may also reference our contribution guide for details on how to submit a pull request (PR) for this repository.

Источник

Android API reference

Start building your Android app with the Android Platform APIs. They are available in Kotlin and Java.

Note: Many Kotlin reference topics are derived from Java-based source code. This means that some Kotlin reference topics might contain Java code snippets.

These additional libraries make it easy to add additional functionality and features to your app.

Jetpack

AndroidX Refactored versions of the Android APIs that are not bundled with the operating system.
Reference User Guide Jetpack Compose Jetpack Compose is a modern toolkit for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.
Reference User Guide AndroidX Constraint Layout Includes ConstraintLayout and related APIs for building constraint-based layouts.
Reference User Guide For ConstraintLayout in Compose.
Reference Databinding Library Includes APIs to help you write declarative layouts and minimize the glue code necessary to bind your application logic and layouts.
Reference User Guide

Device Libraries

Other Libraries

Material Components Material Components for Android (MDC-Android) help developers execute Material Design to build beautiful and functional Android apps.
Reference User Guide Android NDK The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++.
Reference User Guide Android Game Development Kit libraries The Android Game Development Kit C/C++ game libraries make it easier to build, debug, optimize, and maintain your games.
Overview Android Gradle Plugin The Android Gradle Plugin (AGP) is the supported build system for Android applications and includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
Reference User Guide Cross device SDK The Cross device SDK simplifies the development of rich and engaging multi-device experiences. Its core functionality includes device discovery and authorization, secure connections and data transfers, and multi-device sessions.
Reference User Guide

Читайте также:  Layout in java with examples

Google Play

Play In-app Billing Library Provides APIs to help you implement Google Play’s in-app billing and subscription features.
Reference User Guide Play Core Library Provides APIs to help you request, monitor, and manage on demand downloads for Play Feature Delivery, Play Asset Delivery, and offers additional APIs such as in-app updates and in-app reviews. This library is available in Java, Native code, and Unity. Play Install Referrer library Provides APIs to securely retrieve referral content from Google Play.
Reference

Google Assistant

Built-in Intents Let users launch and control your Android app with their voice, using Google Assistant and App Actions.

Deprecated Libraries

These libraries are superseded by the AndroidX libraries and are no longer maintened. They are still shipped in the SDK to support legacy apps. For more information see the androidx migration guide. Android Support Library Provided a variety of Android feature and utility APIs that are compatible with a wide range of platform versions. The original library is superseded by the AndroidX libraries. Android Test Support Library Includes APIs for testing your Android app, including Espresso, JUnit Runner, JUnit4 rules, and UI Automator. The original library is superseded by the AndroidX Test library. Architecture Components Includes APIs for a variety of core app components, such as APIs that manage your UI component lifecycle, data persistence, view model, and more. The original library is superseded by the AndroidX libraries. Constraint Layout Library Legacy Support Library ConstraintLayout and related APIs for building constraint-based layouts. The original library is superseded by the AndroidX constraintlayout library. Android Things Library Provided APIs to build connected devices running the Android Things platform. The original library is no longer maintained. Android Wearable Library Provides APIs to build apps for wearable devices running Wear OS by Google. The original library is superseded by the AndroidX Wear libraries.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2023-03-02 UTC.

Источник

Android SDK reference

A context is a generalized way of referring to the people, services, machines, or other resources that encounter feature flags in your product. Contexts replace another data object in LaunchDarkly: «users.»

Code samples on this page are from the two most recent SDK versions where they differ. To learn more about upgrading, read Android SDK 3.x to 4.0 migration guide and Best practices for upgrading users to contexts.

This topic documents how to get started with the Android SDK, and links to reference information on all of the supported features.

LaunchDarkly’s SDKs are open source. In addition to this reference guide, we provide source, API reference documentation, and a sample application:

The LaunchDarkly Android SDK is compatible with Android SDK versions 21 and higher (Android 5.0, Lollipop).

Читайте также:  Создать быстро шаблон html

After you complete the Getting started process, follow these instructions to start using the LaunchDarkly SDK in your Android application.

First, declare a dependency on the LaunchDarkly Android SDK:

 
implementation 'com.launchdarkly:launchdarkly-android-client-sdk:4.0.0'

The SDK uses AndroidX from Jetpack. If your project does not use AndroidX, read Android's migration guide.

If you use ProGuard or R8, the aar artifact should automatically include the configuration for the Android SDK. If this is not the case for your build, include the Proguard configuration lines from consumer-proguard-rules.pro into your proguard file.

Next, import the LaunchDarkly client in your application code:

 
import com.launchdarkly.sdk.*;
import com.launchdarkly.sdk.android.*;

The Android SDK uses a mobile key. Your environment's mobile key is available in the Projects tab of your Account settings page. To learn more about key types, read Keys.

After you install the SDK, create a single, shared instance of LDClient . To create a client instance, you need your environment's mobile key. This authorizes your application to connect to a particular environment within LaunchDarkly.

Mobile keys are not secret and you can expose them in your client-side code without risk. However, never embed a server-side SDK key into a client-side application.

It's important to make LDClient a singleton for each LaunchDarkly project. The client instance maintains internal state that allows LaunchDarkly to serve feature flags without making any remote requests. Do not instantiate a new client with every request.

If you have multiple LaunchDarkly projects, you should use the multiple environments feature. To learn more, read Multiple environments.

The following example shows the simplest way to create the client. It will block for up to five seconds until the latest feature flags are retrieved from LaunchDarkly.

In the v4 example, the context key is "context-key-123abc". In the v3 example, the user key is "user-key-123abc".

Here is how to create the client:

 
LDConfig ldConfig = new LDConfig.Builder()
.mobileKey("mobile-key-123abc")
.build();
LDContext context = LDContext.create("context-key-123abc");
LDClient client = LDClient.init(this.getApplication(), ldConfig, context, 5);

However, calling blocking code from the main thread in an Android app is not a best practice. The preferred method allows you to use the client immediately. The app stores flags from the previous launch on the device and retrieves them for immediate use. The client still connects in the background and continually updates itself with the latest flags.

You must make feature flags available to mobile SDKs before the SDK can evaluate those flags. If an SDK tries to evaluate a feature flag that is not available, the context will receive the fallback value for that flag.

To make a flag available to this SDK, check the SDKs using Mobile key checkbox during flag creation, or on the flag's Settings tab. To make all of a project's flags available to this SDK by default, check the SDKs using Mobile key checkbox in your project Settings.

Here is the preferred method:

Источник

Оцените статью