Android app example github
PyTorch Android Examples
A list of Android demo apps built on the powerful PyTorch Mobile platform.
HelloWorld is a simple image classification application that demonstrates how to use the PyTorch Android API with the latest PyTorch 1.8, MobileNet v3, and MemoryFormat.CHANNELS_LAST.
PyTorch demo app
The PyTorch demo app is a full-fledged app that contains two showcases. A camera app that runs a quantized model to classifiy images in real time. And a text-based app that uses a text classification model to predict the topic from the input text.
D2Go demonstrates a Python script that creates the much lighter and much faster Facebook D2Go model that is powered by PyTorch 1.8, torchvision 0.9, and Detectron2 with built-in SOTA networks for mobile, and an Android app that uses it to detect objects from pictures in your photos, taken with camera, or with live camera. This demo app also shows how to use the native pre-built torchvision-ops library.
Image Segmentation demonstrates a Python script that converts the PyTorch DeepLabV3 model and an Android app that uses the model to segment images.
Object Detection demonstrates how to convert the popular YOLOv5 model and use it in an Android app that detects objects from pictures in your photos, taken with camera, or with live camera.
Neural Machine Translation
Neural Machine Translation demonstrates how to convert a sequence-to-sequence neural machine translation model trained with the code in the PyTorch NMT tutorial and use the model in an Android app to do French-English translation.
Question Answering demonstrates how to convert a powerful transformer QA model and use the model in an Android app to answer questions about PyTorch Mobile and more.
Speech Recognition demonstrates how to convert Facebook AI’s wav2vec 2.0, one of the leading models in speech recognition, to TorchScript and how to use the scripted model in an Android app to perform speech recognition.
Vision Transformer demonstrates how to use Facebook’s latest Vision Transformer DeiT model to do image classification, and how convert another Vision Transformer model and use it in an Android app to perform handwritten digit recognition.
Speech Recognition demonstrates how to convert Facebook AI’s wav2vec 2.0, one of the leading models in speech recognition, to TorchScript and how to use the scripted model in an Android app to perform speech recognition.
TorchVideo demonstrates how to use a pre-trained video classification model, available at the newly released PyTorchVideo, on Android to see video classification results, updated per second while the video plays, on tested videos, videos from the Photos library, or even real-time videos.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS «AS IS» AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
About
PyTorch android examples of usage in applications
Источник
Android app example github
Android Architecture Blueprints v2
Android Architecture Blueprints is a project to showcase different architectural approaches to developing Android apps. In its different branches you’ll find the same app (a TODO app) implemented with small differences.
In this branch you’ll find:
- Kotlin Coroutines for background operations.
- A single-activity architecture, using the Navigation component to manage fragment operations.
- A presentation layer that contains a fragment (View) and a ViewModel per screen (or feature).
- Reactive UIs using LiveData observables and Data Binding.
- A data layer with a repository and two data sources (local using Room and remote) that are queried with one-shot operations (no listeners or data streams).
- Two product flavors, mock and prod , to ease development and testing (except in the Dagger branch).
- A collection of unit, integration and e2e tests, including «shared» tests that can be run on emulator/device or Robolectric.
This project hosts each sample app in separate repository branches. For more information, see the README.md file in each branch.
Stable samples — Kotlin
Sample | Description |
---|---|
master | The base for the rest of the branches. Uses Kotlin, Architecture Components, coroutines, Data Binding, etc. and uses Room as source of truth, with a reactive UI. |
dagger-android [compare] | A simple Dagger setup that uses dagger-android and removes the two flavors. |
usecases [compare] | Adds a new domain layer that uses UseCases for business logic. |
Old samples — Kotlin and Java
Blueprints v1 had a collection of samples that are not maintained anymore, but can still be useful. See all project branches.
The app in this project aims to be simple enough that you can understand it quickly, but complex enough to showcase difficult design decisions and testing scenarios. For more information, see the app’s specification.
- A UI/Material Design sample. The interface of the app is deliberately kept simple to focus on architecture. Check out Plaid instead.
- A complete Jetpack sample covering all libraries. Check out Android Sunflower or the advanced Github Browser Sample instead.
- A real production app with network access, user authentication, etc. Check out the Google I/O app, Santa Tracker or Tivi for that.
- Intermediate developers and beginners looking for a way to structure their app in a testable and maintainable way.
- Advanced developers looking for quick reference.
Opening a sample in Android Studio
To open one of the samples in Android Studio, begin by checking out one of the sample branches, and then open the root directory in Android Studio. The following series of steps illustrate how to open the usecases sample.
Clone the repository:
This step checks out the master branch. If you want to change to a different sample:
Note: To review a different sample, replace usecases with the name of sample you want to check out.
Finally open the android-architecture/ directory in Android Studio.
About
A collection of samples to discuss and showcase different architectural tools and patterns for Android apps.
Источник
Android app example github
Jetpack Compose Samples
This repository contains a set of individual Android Studio projects to help you learn about Compose in Android. Each sample demonstrates different use cases, complexity levels and APIs.
For more information, please read the documentation
To try out these sample apps, you need to use Android Studio Arctic Fox. You can clone this repository or import the project from Android Studio following the steps here.
A sample blog post viewer that demonstrates the use of Compose with a typical Material app and real-world architecture.
• Medium complexity
• Varied UI
• Light & dark themes
• Resource loading
• UI Testing
A sample chat app that focuses on UI state patterns and text input.
• Low complexity
• Material Design 3 theme and Material You dynamic color
• Resource loading
• Back button handling
• Integration with Architecture Components: Navigation, Fragments, LiveData, ViewModel
• Animation
• UI Testing
A sample survey app that showcases text input, validation and UI state management in Compose.
• Low complexity
• TextField and form validation
• Snackbar implementation
• Element reusability and styling
• Various form elements
Jetsnack is a sample snack ordering app built with Compose.
• Medium complexity
• Custom design system
• Custom layouts
• Animation
A sample podcast app that features a full-featured, Redux-style architecture and showcases dynamic themes.
• Advanced sample
• Dynamic theming using podcast artwork
• Image fetching
• WindowInsets support
• Coroutines
• Local storage with Room
A Compose implementation of the Rally Material study, a financial app that focuses on data, charts, reusability and animations.
• Low complexity
• Material theming with a dark-only theme
• Custom layouts and reusable elements
• Charts and tables
• Animations
• Screenshot tests
A Compose implementation of the Crane Material study, a travel app that uses Material Design components and Material Theming to create a personalized, on-brand experience.
• Medium complexity
• Draggable UI elements
• Android Views inside Compose
• UI state handling
• UI Tests
A Compose implementation of the Owl Material study. The Owl brand uses bold color, shape, and typography to express its brand attributes: energy, daring, and fun.
• Medium complexity
• Material theming & light/dark themes
• Custom layout
• Animation
A catalog of Material Design components and features available in Jetpack Compose. See how to implement them and how they look and behave on real devices.
• Lives in AOSP—always up to date
• Uses the same samples as API reference docs
• Theme picker to change Material Theming values at runtime
• Links to guidelines, docs, source code, and issue tracker
A gardening app illustrating Android development best practices with Android Jetpack. The compose branch is partially built with Jetpack Compose.
• Compose working in an existing app: including integration with strings, resources, and themes and styles
• Integration with an existing architecture based on Jetpack libraries
• CollapsingToolbarLayout behavior implemented manually with Compose
• Showing Snackbars with Compose
A work-in-progress TV show tracking Android app, which connects to Trakt.tv.
• Entirely written in Kotlin and uses Kotlin Coroutines throughout
• Uses many of the Architecture Components: Room, Lifecycle, Navigation
• Uses Hilt for dependency injection
Источник
Android app example github
Smartlook Demo for Android
It serves as a tool for developers and teams that would like to deploy Smartlook in their application. With this app, they can try out all the key features without having to integrate the SDK into their own application. Everything is already ready and available for immediate use.
- Clone this repository and install application on your device
- Sign up to Smartlook in order to create a testing Demo project and acquire the project’s API key that will be necessary in order to start session recordings in your demo project.
- During the account’s creation process please select Mobile app project.
- Once the onboarding is completed, you will be presented with your project’s API key that needs to be served to the sample app that you installed.
- When you run the sample application for the first time, the initial screen asks you to input the API key. This is the key we acquired in the previous step.
- In the next step you may input the user ID that will be shown in Smartlook dashboard to identify the session recording you will create.
Now that you entered the info, the session recording is initiated. You may browse freely and the session will be then available in Smartlook account that you created in step 1.
Outside of auto-tracked events, our sample application has some Custom events implemented as well. So once you navigate to Events tab in Smartlook Dashboard, you may use them to interact with Events manager.
The sample application also has a specific scenario created in it that you may look at some drop-offs in the funnel (you need to compose a funnel within your testing account).
- Once you initiate a replay of a video inside the sample application, you may download the video (initial step of the funnel).
- The app will notify you that you need to subscribe in order to be able to download videos.
- There is a user login screen here:
We have 3 sets of credentials with pre-defined output:
- uname: user1 ; pw: user1 — the plan subscription is successful and you will be able to download the video
- The first credential set will allow you to subscribe and then download the video into your phone. This is considered a successful conversion in our demo funnel. Other credential sets will disallow you to complete the funnel.
- Please note — in case these credentials are entered, they are stored and you would need to remove app’s temporary data and files (from OS app settings area) that will allow you to re-enter other credential set
- uname: user2 ; pw: user2 — the plan subscription is unsuccessful; account not activated
- uname: user3 ; pw: user3 — the plan subscription is unsuccessful; account activated but insufficient funds error
After your browsing is done, you may leave the app and it will be terminated after 5 minutes of inactivity. Alternatively, you may manually kill the app and terminate the session recording at once.
After the data is uploaded, your session replay will be stored & visible in the Smartlook account you created in step 1.
Please feel free to share some feedback with us either with your account representative or directly in an email to support@smartlook.com
Smartlook Demo app is based on NewPipe, A libre lightweight streaming frontend for Android.
NewPipe is Free Software: You can use, study share and improve it at your will. Specifically you can redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Источник