full_name
stringlengths 22
46
| owner
stringlengths 4
14
| name
stringlengths 11
32
| html_url
stringlengths 41
65
| is_template
bool 1
class | description
stringlengths 20
161
| template_keywords
stringclasses 6
values | license
stringclasses 2
values | topics
stringlengths 2
178
| size
int64 70
37.8k
| language
stringclasses 2
values | created_at
stringlengths 19
19
| updated_at
stringlengths 19
19
| gpt_description
stringlengths 20
161
| repo_symbols_count
int64 62.9k
100k
| repo_tokens_count
int64 15.8k
25.1k
| repo_words_count
int64 7.4k
11.9k
| repo_lines_count
int64 1.91k
2.8k
| repo_files_count
int64 42
71
| repo_code_symbols_count
int64 0
0
| repo_code_tokens_count
int64 0
0
| repo_code_words_count
int64 0
0
| repo_code_lines_count
int64 0
0
| repo_code_files_count
int64 0
0
| description_symbols_count
int64 20
161
| description_tokens_count
int64 5
87
| description_words_count
int64 3
27
| description_lines_count
int64 1
1
| readme
stringlengths 516
12.2k
| readme_symbols_count
int64 516
12.2k
| readme_tokens_count
int64 137
2.41k
| readme_words_count
int64 36
1.17k
| readme_lines_count
int64 9
182
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
amzn/firetv-sample-touch-app | amzn | firetv-sample-touch-app | https://github.com/amzn/firetv-sample-touch-app | false | This sample Android project demonstrates how to build the main UI of a Fire TV application in order to support both Touch interactions and Remote D-Pad controls. | ['demo', 'sample'] | Apache License 2.0 | ['amazon', 'android', 'apps', 'appstore', 'firetv', 'ott', 'sample', 'sample-app', 'samples', 'template', 'tv'] | 111 | Java | 2021-06-28T01:37:39 | 2023-11-04T04:44:13 | This sample Android project demonstrates how to build the main UI of a Fire TV application in order to support both Touch interactions and Remote D-Pad controls. | 69,643 | 17,038 | 8,491 | 1,994 | 55 | 0 | 0 | 0 | 0 | 0 | 161 | 30 | 27 | 1 | Fire TV Sample App Android - Touch and D-Pad
This sample Android project demonstrates how to build the main UI of a Fire TV application in order to support both Touch interactions and Remote D-Pad controls.
This project can be imported in Android Studio (tested on Android Studio 4.1.1).
Make sure sure to check out the [related tutorial on the Amazon Developer Blog](https://developer.amazon.com/blogs/appstore/post/63ff3988-9d3d-44d5-bbec-111f46895669/how-to-add-touch-interactions-to-android-based-fire-tv-applications)
![Screenshot](/images/screenshot.jpg)
## How to use this repository
1. Clone or download the repository
2. Import the project in Android Studio
3. Run the app
## Which devices can you run this sample app on
You can run this sample app on:
1. Amazon Fire TV device (Fire OS 5+) - recommended
2. Android TV emulator (API 21+)
## How to test Touch on Fire TV devices without a touchscreen
The easiest solution is to connect a wireless mouse to your Amazon Fire TV. Mouse on Android simulates touch interaction. You can do this by:
1. Going to "Settings"
2. Go to "Remote and Bluetooth Devices"
3. Go to "Other Bluetooth devices"
4. Follow the on-screen instructions on how to connect your Bluetooth mouse
5. After connecting the mouse, go back to your app. The mouse will show a cursor on screen you can use to simulate touch interactions, including clicks and gestures.
## License
This project is licensed under the Apache-2.0 License. | 1,467 | 352 | 225 | 22 |
arkivanov/decompose-dagger-sample | arkivanov | decompose-dagger-sample | https://github.com/arkivanov/decompose-dagger-sample | false | A sample Android project demonstrating the use of Decompose library together with Dagger DI framework | ['demo', 'sample'] | MIT License | [] | 70 | Kotlin | 2023-10-10T08:41:09 | 2023-11-08T08:15:03 | A sample Android project demonstrating the use of Decompose library together with Dagger DI framework | 64,618 | 15,780 | 7,548 | 2,112 | 64 | 0 | 0 | 0 | 0 | 0 | 101 | 16 | 15 | 1 | Decompose Dagger Sample
This is a sample Android project demonstrating the use of [Decompose](https://github.com/arkivanov/Decompose) library together with [Dagger](https://github.com/google/dagger) DI framework.
## Project Structure
The project consists of the following modules:
- `repository` - Contains a simple in-memory `Repository`, shared in feature modules.
- `feature-list` - Contains `ListComponent` that shows a list of text items. Clicking on an item opens `DetailsComponent`.
- `feature-details` - Contains `DetailsComponent` that shows the previously selected item.
- `feature-root` - Contains `RootComponent` that navigates between `ListComponent` and `DetailsComponent`, plus some unit tests for `DefaultRootComponent`.
- `app-android` - Contains `MainActivity` that shows `RootComponent`. | 808 | 177 | 96 | 9 |
edgar-zigis/CoroutineRecipes | edgar-zigis | CoroutineRecipes | https://github.com/edgar-zigis/CoroutineRecipes | false | Playground for Kotlin Coroutines. Basics, Channels, Flows, useful examples & comparison to RxJava. | ['example'] | Apache License 2.0 | ['example', 'kotlin', 'kotlin-android', 'kotlin-coroutines', 'kotlin-coroutines-tutorial', 'tutorial'] | 95 | Kotlin | 2020-07-15T07:58:31 | 2023-05-17T01:36:01 | Playground for Kotlin Coroutines. Basics, Channels, Flows, useful examples & comparison to RxJava. | 74,324 | 18,693 | 9,768 | 2,502 | 42 | 0 | 0 | 0 | 0 | 0 | 98 | 22 | 13 | 1 | Coroutine Recipes
Playground for Kotlin Coroutines.<br/>
Ready to use ***IntelliJ IDEA*** project with basic explanations.
```
* Basic async/launch comparisons
* Job/Deferred completion invocations & cancellations
* Context tests
* Basic & Supervisor scopes. Cancellation & exception handling.
* Concurrent & serial tasks. Comparison with RxJava.
* Critical section handling
* Resource access from different threads
* Channels, BroadcastChannels, ConflatedBroadcastChannels
* Channel buffers
* Differences between Channels and Flows
* Basic Flow operators
* State & Shared Flows
* Callback & Channel Flows
```
**Project is under continuous development** | 654 | 137 | 89 | 19 |
ErfanSn/AugmentedVideo | ErfanSn | AugmentedVideo | https://github.com/ErfanSn/AugmentedVideo | false | 🎥 A sample of augmented video with SceneView in both Compose And ViewSystem | ['sample'] | Apache License 2.0 | ['android', 'augmented-reality', 'filament', 'kotlin', 'sceneview'] | 37,787 | Kotlin | 2023-04-07T01:13:53 | 2023-12-22T02:48:29 | 🎥 A sample of augmented video with SceneView in both Compose And ViewSystem | 100,338 | 25,149 | 11,904 | 2,797 | 71 | 0 | 0 | 0 | 0 | 0 | 76 | 18 | 13 | 1 | AugmentedVideo
A sample of augmented video with [SceneView](https://github.com/SceneView/sceneview-android) for two UI toolkit the Android View System and Compose.
## Specifing UI Toolkit
To specify the type of UI toolkit used in project output, it is enough to change **Build Variant** from **Window Tool Bar**.
## Demo
![Matrix](/media/demo.gif)
## License
```
Copyright 2023 Erfan Sn
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
``` | 914 | 206 | 133 | 19 |
genexuslabs/SDExtensionsSample | genexuslabs | SDExtensionsSample | https://github.com/genexuslabs/SDExtensionsSample | false | This repository contains extensions samples for the Native Mobile generators. | ['sample'] | MIT License | ['android', 'genexus', 'ios'] | 206 | Kotlin | 2016-09-14T04:40:23 | 2023-11-22T02:32:45 | This repository contains extensions samples for the Native Mobile generators. | 62,933 | 16,691 | 7,621 | 2,050 | 51 | 0 | 0 | 0 | 0 | 0 | 77 | 11 | 10 | 1 | Native Mobile Extension Sample
This sample contains:
- A `User Control` definition.
- An `External Object` definition.
- An `Android Library` project of a `GeneXus Module` that implements the two previously defined extensions.
- An `GeneXus Library` definition which declares the `Android Library` which implements the `User Control` and `External Object` in Android and its corresponding `GeneXus Module` name.
- An implementation for iOS for the User Control and External Object.
- An app that lets you try out both extensions.
## Requirements
- GeneXus (latest upgrade is recommended)
- JDK and Android SDK for Android generator
- MAC machine for iOS generator
For more details see:
- [Android Requirements for GeneXus](http://wiki.genexus.com/commwiki/servlet/wiki?14449).
- [iOS Requirements for GeneXus](https://wiki.genexus.com/commwiki/servlet/wiki?19478).
## Instructions
### Import the GeneXus Library definition to GeneXus
- Copy the `SampleLibrary` directory to the `Libraries` directory in your GeneXus installation.
### Import the User Control definition in GeneXus
- Copy the `BasicUserControl` directory to the `UserControls` directory in your GeneXus installation.
- Run `genexus.exe /install` in a command line in the Genexus installation directory.
### Import the External Object definition in GeneXus
- Open GeneXus and open the KB to work with.
- Import the _BasicExternalObject_ definition from `BasicExternalObject\BasicExternalObject.xpz`.
### Import the sample app (optional).
To try out the _BasicUserControl_ and _BasicExternalObject_ samples you may wish to import the sample app from `SampleApp\BasicSample.xpz`.
## Android specific
### Build and Deploy the GeneXus Android Module to GeneXus
- Set the following system environment variables:
- `GENEXUS_REPO` to GeneXus Android Maven repository located in `Android\m2repository` inside your GeneXus installation (e.g. `file:///C:/path/to/GX/Android/m2Repository`, making sure it starts with the `file` scheme).
- `ANDROID_HOME` to your Android SDK directory.
- Run the command `gradlew publishDebugPublicationToInternalRepository` from the `SampleModule` directory.
### Considerations
- Take into account that this project uses the latest `FlexibleClient` version installed at `GENEXUS_REPO`. If you need to work with a specific one, you will have to replace it in [library/build.gradle](https://github.com/genexuslabs/SDExtensionsSample/blob/master/SampleModule/library/build.gradle) file.
## Further reading
### User Controls
- [User Control definition file syntax](http://wiki.genexus.com/commwiki/servlet/wiki?13309)
- [User Control properties file syntax](http://wiki.genexus.com/commwiki/servlet/wiki?27179)
- [External Objects for Smart Devices](https://wiki.genexus.com/commwiki/servlet/wiki?17880)
### External Objects
- [External Object definition](http://wiki.genexus.com/commwiki/servlet/wiki?6148)
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE.txt) file for more details. | 3,011 | 699 | 367 | 43 |
Hitman666/AndroidCallBlockingTestDemo | Hitman666 | AndroidCallBlockingTestDemo | https://github.com/Hitman666/AndroidCallBlockingTestDemo | false | A demo native Android app that can block an incoming call | ['demo'] | MIT License | [] | 135 | Java | 2018-02-22T07:33:52 | 2023-10-11T06:46:07 | A demo native Android app that can block an incoming call | 66,727 | 17,499 | 7,424 | 1,990 | 54 | 0 | 0 | 0 | 0 | 0 | 57 | 11 | 11 | 1 | How to make a native Android app that can block phone calls
## TL;DR
In this post, I'll show you step by step how to make a native Android app that can block certain numbers from calling you.
I hope that my step by step guide that I'm going to show you here will help you and save you from doing additional research.
_Of course, since I'm not a native Android developer in my day to day job, I'm doing it also for the fact that it will serve me as a good reminder for when I need to deal with a similar situation again._ Shout out to the rest of you #jackOfAllTrades out there 💪
Also, given the statement above; I would appreciate any feedback regarding this code. 🙏
## !TL;DR
I've spent a lot of time going through StackOverflow and blog posts in search of this solution. Of all of those, these were helpful:
+ [How to detect incoming calls on an Android device?
](https://stackoverflow.com/questions/15563921/how-to-detect-incoming-calls-in-an-android-device/15564021)
+ [Can't answer incoming call in android marshmallow 6.0
](https://stackoverflow.com/questions/42339534/cant-answer-incoming-call-in-android-marshmallow-6-0)
+ [Android permission doesn't work even if I have declared it
](https://stackoverflow.com/questions/32635704/android-permission-doesnt-work-even-if-i-have-declared-it)
+ [End incoming call programmatically
](https://stackoverflow.com/questions/20965702/end-incoming-call-programmatically)
+ [Is the phone ringing](http://gabesechansoftware.com/is-the-phone-ringing/)
But sadly, none of them was straightforward, beginner kind of tutorial. So, after a lot of additional research, I made it work, and here's my best attempt at explaining how.
> As a sidenote: while testing this, the discovery of [how to simulate an incoming call or SMS to an emulator in Android Studio](http://www.nikola-breznjak.com/blog/android/simulate-incoming-call-sms-emulator-android-studio/) was also very helpful.
### Starting a new project
In Android Studio go to `File->New->New Project`, give it a name and a location and click `Next`:
![](https://i.imgur.com/4iyIDSJ.png)
Leave the default option for minimum API level:
![](https://i.imgur.com/wBim1w2.png)
Select an `Empty Activity` template:
![](https://i.imgur.com/eLo7Sia.png)
Leave the name of the activity as is:
![](https://i.imgur.com/8M3pwcQ.png)
### AndroidManifest.xml
Set the permissions (two `uses-permission` tags) and the `receiver` tags in `AndroidManifest.xml` file:
```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.nikola.callblockingtestdemo">
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".IncomingCallReceiver" android:enabled="true" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
</application>
</manifest>
```
With the `READ_PHONE_STATE` permission we get this (as defined in [official docs](https://developer.android.com/reference/android/Manifest.permission.html#READ_PHONE_STATE)):
> Allows read-only access to phone state, including the phone number of the device, current cellular network information, the status of any ongoing calls, and a list of any PhoneAccounts registered on the device.
With the `CALL_PHONE` permission we get this (as defined in [official docs](https://developer.android.com/reference/android/Manifest.permission.html#CALL_PHONE)):
> Allows an application to initiate a phone call without going through the Dialer user interface for the user to confirm the call.
⚠️ I found that even though not stated here, I need this permission so that I can end the call programmatically.
The `receiver` tag is used to define a class that will handle the broadcast action of `android.intent.action.PHONE_STATE`. Android OS will broadcast this action when, as the name implies, the state of the phone call changes (we get a call, decline a call, are on the call, etc.).
### IncomingCallReceiver.java
Create a new class (`File->New->Java Class`), call it `IncomingCallReceiver` and paste this code in (_note: your `package` name will be different than mine!_):
```
package com.example.nikola.callblockingtestdemo;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.TelephonyManager;
import android.widget.Toast;
import java.lang.reflect.Method;
import com.android.internal.telephony.ITelephony;
public class IncomingCallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
ITelephony telephonyService;
try {
String state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
String number = intent.getExtras().getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING)){
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
try {
Method m = tm.getClass().getDeclaredMethod("getITelephony");
m.setAccessible(true);
telephonyService = (ITelephony) m.invoke(tm);
if ((number != null)) {
telephonyService.endCall();
Toast.makeText(context, "Ending the call from: " + number, Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
}
Toast.makeText(context, "Ring " + number, Toast.LENGTH_SHORT).show();
}
if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_OFFHOOK)){
Toast.makeText(context, "Answered " + number, Toast.LENGTH_SHORT).show();
}
if(state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_IDLE)){
Toast.makeText(context, "Idle "+ number, Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
In Android, if we want to 'get' the data from the `BroadcastReceiver`, we need to inherit the `BroadcastReceiver` class, and we need to override the `onReceive` method. In this method, we're using the `TelephonyManager` to get the state of the call, and we're using the `ITelephony` interface to end the call.
To be honest, this is where it gets a bit 'weird', as to get this `ITelephony` interface, you need to create the `ITelephony` interface.
### ITelephony.java
To do that, create a new class (`File->New->Java Class`), call it `ITelephony` and paste this code in (_note: overwrite everything with the below content; yes, even the weird package name_):
```
package com.android.internal.telephony;
public interface ITelephony {
boolean endCall();
void answerRingingCall();
void silenceRinger();
}
```
Android Studio will complain about `package com.android.internal.telephony;` (red squiggly dots under this package name), but that's how it has to be set for this to work. I didn't find the exact explanation why this has to be included, so if you know, please share it in the comments.
### Requesting permissions at runtime
This was one thing that was hindering my success in getting this to work!
Namely, after Android 6.0+, even if you have permissions set in the `AndroidManifest.xml` file, you still have to explicitly ask the user for them if they fall under the category of **dangerous** permissions. This is the list of such permissions:
+ ACCESS_COARSE_LOCATION
+ ACCESS_FINE_LOCATION
+ ADD_VOICEMAIL
+ BODY_SENSORS
+ CALL_PHONE
+ CAMERA
+ GET_ACCOUNTS
+ PROCESS_OUTGOING_CALLS
+ READ_CALENDAR
+ READ_CALL_LOG
+ READ_CELL_BROADCASTS
+ READ_CONTACTS
+ READ_EXTERNAL_STORAGE
+ READ_PHONE_STATE
+ READ_SMS
+ RECEIVE_MMS
+ RECEIVE_SMS
+ RECEIVE_WAP_PUSH
+ RECORD_AUDIO
+ SEND_SMS
+ USE_SIP
+ WRITE_CALENDAR
+ WRITE_CALL_LOG
+ WRITE_CONTACTS
+ WRITE_EXTERNAL_STORAGE
To ask for such permissions here's the code you can use (I used it in `MainActivity.java` in the `onCreate` method):
```
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
if (checkSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_DENIED || checkSelfPermission(Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_DENIED) {
String[] permissions = {Manifest.permission.READ_PHONE_STATE, Manifest.permission.CALL_PHONE};
requestPermissions(permissions, PERMISSION_REQUEST_READ_PHONE_STATE);
}
}
```
The `PERMISSION_REQUEST_READ_PHONE_STATE` variable is used to determine which permission was asked for in the `onRequestPermissionsResult` method. Of course, if you don't need to execute any logic depending on whether or not the user approved the permission, you can leave out this method:
```
@Override
public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
switch (requestCode) {
case PERMISSION_REQUEST_READ_PHONE_STATE: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, "Permission granted: " + PERMISSION_REQUEST_READ_PHONE_STATE, Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(this, "Permission NOT granted: " + PERMISSION_REQUEST_READ_PHONE_STATE, Toast.LENGTH_SHORT).show();
}
return;
}
}
}
```
### App in action
This is how the app looks like in action, tested on the emulator and call triggered by using [Android Device Monitor](http://www.nikola-breznjak.com/blog/android/simulate-incoming-call-sms-emulator-android-studio/) in Android Studio:
![](https://i.imgur.com/CjU9D4J.gif)
## Conclusion
In this post, I showed you how to make a native Android app that can block certain numbers from calling you. I pointed out the blocker that I was facing, and I'm still searching a solution to hide a native incoming call popup that still sometimes shows up for a brief second before the call gets rejected.
So, if you have any ideas, I'm open to suggestions 💪
## License
[MIT](LICENSE) | 10,875 | 2,408 | 1,171 | 182 |
HMS-Core/hms-analytics-demo-android | HMS-Core | hms-analytics-demo-android | https://github.com/HMS-Core/hms-analytics-demo-android | false | HmsAnalyticsKitDemo is a app that applying HUAWEI Hianalytics SDK used for showing how to collect user engagement and user preference. | ['demo'] | Apache License 2.0 | ['analyse', 'analyse-data', 'analytics', 'analytics-tracking', 'android', 'hms', 'huawei', 'user-preference'] | 192 | Java | 2020-06-19T06:19:32 | 2023-05-03T04:40:14 | HmsAnalyticsKitDemo is a app that applying HUAWEI Hianalytics SDK used for showing how to collect user engagement and user preference. | 95,481 | 24,541 | 9,478 | 2,747 | 68 | 0 | 0 | 0 | 0 | 0 | 134 | 30 | 20 | 1 | HMS AnalyticsKit Demo for Android
English | [中文](README_ZH.md)
## Table of Contents
* [Introduction](#introduction)
* [Getting Started](#getting-started)
* [Installation](#installation)
* [Configuration ](#configuration )
* [Environment requirements](#environment-requirements)
* [Result](#result)
* [License](#license)
## Introduction
Hmsanalyticskitdemo provides an example of integrating HUAWEI Analytics Kit with an app. It illustrates how to collect predefined events and custom events to improve user engagement and user preference.
[Read more about Hianalytics](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/introduction-0000001050745149).
You also can use HMS Toolkit to quickly integrate the kit and run the **Java** demo project, as well as debug the app using a remote device for free. For details, please visit [HMS Toolkit](https://developer.huawei.com/consumer/en/doc/development/Tools-Guides/getting-started-0000001077381096).
## Getting Started
For more development guidance, please refer to the links below:
[Development Guide](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-dev-process-0000001050163813).
[API References](https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/android-api-analytics-overview-0000001051067140).
In this example, we demonstrate how to use the analytics SDK for Android by using the Gradle build system.
First download Hmsanalyticskitdemo by cloning this repository or downloading an archived snapshot.
In Android Studio, click Open an existing Android Studio project, and select "java" or "kotlin".
You can use the gradlew build command to build the project directly.
You should create an app in AppGallery Connect, and obtain the agconnect-services.json file and add it to the project. More to [Development Process](https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/android-dev-process-0000001050163813).
## Installation
Use Android Studio to open the decompressed project.
## Configuration
1. Create an app in AppGallery Connect and obtain the project configuration file agconnect-services.json. In Android Studio, switch to the Project view and move the agconnect-services.json file to the root directory of the app.
2. Change the value of applicationId in the build.gradle file of the app to the name of the app package applied for in the preceding step.
## Environment requirements
Hardware requirements:
1. A computer (desktop or laptop)
2. A Huawei phone, which is used to debug the developed app
Software requirements:
1. HUAWEI Analytics Kit 6.7.0
2. Android SDK applicable to devices using Android 4.3 Jelly Bean (API level 18) and later versions
3. Android Studio
4. JDK version: 1.8 or later
## Result
After running the app you should see a screen like this:
<img src="images/screen_0.PNG" width=250 div align=center border=5>
Click TRUE or FALSE to answer the question; Click NEXT to show the next question; Click POST SCORE, log the score user got. All the information will be uploaded to the Hianalytics Console, and you can see these information in real time using Debug View.
Click button SETTINGS:
<img src="images/screen_1.PNG" width=250 div align=center border=5>
When you click SETTINGS, you will be asked for your favorite sport. Your choice will be logged by Hianalytics as a user attribute.
## Question or issues
If you want to evaluate more about HMS Core,
[HMSCore on Reddit](https://www.reddit.com/r/HuaweiDevelopers/) is for you to keep up with latest news about HMS Core, and to exchange insights with other developers.
If you have questions about how to use HMS samples, try the following options:
- [Stack Overflow](https://stackoverflow.com/questions/tagged/huawei-mobile-services?tab=Votes) is the best place for any programming questions. Be sure to tag your question with
`huawei-mobile-services`.
- [Huawei Developer Forum](https://forums.developer.huawei.com/forumPortal/en/home?fid=0101187876626530001) HMS Core Module is great for general questions, or seeking recommendations and opinions.
If you run into a bug in our samples, please submit an [issue](https://github.com/HMS-Core/hms-ananlytics-demo-android/issues) to the Repository. Even better you can submit a [Pull Request](https://github.com/HMS-Core/hms-ananlytics-demo-android/pulls) with a fix.
## License
HmsAnalyticsKitDemo is licensed under the [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). | 4,483 | 1,030 | 545 | 56 |
janishar/annotation-processing-example | janishar | annotation-processing-example | https://github.com/janishar/annotation-processing-example | false | It is the example project for the annotation processing tutorial. | ['example'] | Apache License 2.0 | ['android', 'annotation-processing', 'annotation-processor', 'butterknife', 'example', 'example-code', 'example-project', 'java', 'library', 'mindorks', 'modules', 'tutorial'] | 182 | Java | 2018-05-22T06:33:46 | 2023-10-18T08:18:15 | It is the example project for the annotation processing tutorial. | 81,408 | 19,985 | 8,911 | 2,397 | 67 | 0 | 0 | 0 | 0 | 0 | 66 | 12 | 10 | 1 | Android Annotation Processing Tutorial: Example Project
> A complete library implementation
Annotation processing has become one of the most important language features in the modern Java programming. Java supports annotation processing from the release of Java 5 but its full potential has been realized in the recent years. Annotation processing in simple words is used to generate files during compilation.
# About The Author
You can connect with me here:
* [Janishar Ali](https://janisharali.com)
* [Twitter](https://twitter.com/janisharali)
* [YouTube Channel](https://www.youtube.com/@unusualcode)
### The links to the tutorials:
1. [Part 1 : A practical approach](https://janisharali.com/blog/android-annotation-processing-tutorial-part-1-a-practical-approach)
2. [Part 2: The project structure](https://janisharali.com/blog/android-annotation-processing-tutorial-part-2-the-project-structure)
3. [Part 3: Generate Java source code](https://janisharali.com/blog/android-annotation-processing-tutorial-part-3-generate-java-source-code)
4. [Part 4: Use the generated code](https://janisharali.com/blog/android-annotation-processing-tutorial-part-4-use-the-generated-code)
# If this repository helps you in anyway, show your love :heart: by putting a :star: on this project :v:
### How do I use this project?
This is a project aimed to help bootstrap new Android library for annotation processing. Feel free to fork this application.
### License
```
Copyright (C) 2023 JANISHAR ALI ANWAR
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
### Contributing to Android MVP Architecture
All pull requests are welcome, make sure to follow the coding best practices when you submit the pull request. | 2,204 | 492 | 271 | 31 |
jdvp/AndroidAspectExample | jdvp | AndroidAspectExample | https://github.com/jdvp/AndroidAspectExample | false | Project to show examples of leveraging Aspect-Oriented Programming techniques | ['example'] | MIT License | ['android', 'android-aspectj', 'aop', 'aspect-oriented-programming', 'aspectj'] | 478 | Kotlin | 2018-07-03T10:04:02 | 2024-01-09T04:48:25 | Project to show examples of leveraging Aspect-Oriented Programming techniques | 71,375 | 19,715 | 8,432 | 2,153 | 51 | 0 | 0 | 0 | 0 | 0 | 77 | 12 | 9 | 1 | AndroidAspectExample
Project to show examples of leveraging Aspect-Oriented Programming (AOP) techniques
Aspects are defined in AspectLogging.java and affect MainActivity.java.
In order to see that the code has been injected, build the app and check the app/build directory for the
ajc-transform.log file which will show which advices have been added to the project during the build process.
If you run the app, the aspects added will simply log when a button is clicked or onCreate happens.
Created as a sample for my article "[Aspect-Oriented Programming in Android]".
## Releases
Please see the [GitHub Releases Page]
for this example if you want to see details for a specific Android Gradle Plugin (AGP) version.
Each release version for this sample project will correspond to the same AGP version.
## Notes
#### Plugin Change
As of v4.1.0, this sample project leverages the following Gradle Plugin for weaving aspects:
[gradle-aspectj-pipeline-plugin]
Previously, this project was leveraging [android-gradle-aspectj].
For information on why I made the switch, you might be interested in reading my article "[Switching AspectJ Plugins in Android]".
Code required using either plugin is the same since they both use the same aspectjrt library under the hood. The only difference is the required plugin setup in our gradle files.
#### Kotlin 1.5.0 Support
This is more of an issue with AspectJ than this project or even the gradle-aspectj-pipeline-plugin project, but Kotlin code compiled with Kotlin version 1.5.0 now uses invokedynamic to to compile Single Abstract Method functions ([see here] for information in the documentation). This means that lambdas in Kotlin using this version or above will not be weaved as expected as the compiled bytecode will not be able to be matched by AspectJ pointcuts.
To get around this for now, enable the following in project-level build.gradle files:
```groovy
kotlinOptions {
freeCompilerArgs = ["-Xsam-conversions=class"]
}
```
You can read more about the issue [here] if interested.
#### Using newer versions of AspectJ
If you are using AspectJ for some other reason and so want to leverage a different version of the library
other than the one suggested by the Ibotta Plugin (1.9.6), which is used to compile the plugin, you can
generally do so freely up until version 1.9.21 of the AspectJ Plugin (`org.aspectj:aspectjrt`).
If you have a minSdk of 25 or lower, 1.9.22 will likely give you problems. My testing seems to indicate
that this can be fixed by [desugaring].
First, make sure the requisite compile option is set
```groovy
compileOptions {
coreLibraryDesugaringEnabled true
}
```
Then, include the desugaring dependency
```groovy
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
```
Make sure to update this dependency to latest as required.
#### Why I don't recommend AOP in 2023
In late January 2023, the AOP plugin that this project uses, [gradle-aspectj-pipeline-plugin], indicated
that the project would no longer be maintained due to issues with the upcoming AGP 8.0.0 updates removing
required APIs. In response, I wrote "[Why I Don't Recommend Aspect-Oriented Programming in Android in 2023]",
an article that explains why I would be hesitant to use AOP in an enterprise application in 2023.
I did do some research and came to the conclusion that the plugin [would not be broken] by AGP 8.0.0
and as such I will continue updating this sample project (playing both sides??) until the plugin
begins to stop working with AGP or Kotlin updates.
That being said, even though I am going to continue updating this sample app for the foreseeable future,
I would recommend reading "[Why I Don't Recommend Aspect-Oriented Programming in Android in 2023]"
and really thinking about if you actually need to leverage AOP in your project before continuing on
and playing around with the sample project.
[Aspect-Oriented Programming in Android]: https://jdvp.me/articles/AOP-in-Android
[GitHub Releases Page]: https://github.com/jdvp/AndroidAspectExample/releases
[gradle-aspectj-pipeline-plugin]: https://github.com/Ibotta/gradle-aspectj-pipeline-plugin
[android-gradle-aspectj]: https://github.com/Archinamon/android-gradle-aspectj
[Switching AspectJ Plugins in Android]: https://jdvp.me/articles/Switching-AspectJ-Plugins-Android
[see here]: https://kotlinlang.org/docs/whatsnew15.html#sam-adapters-via-invokedynamic
[here]: https://github.com/Ibotta/gradle-aspectj-pipeline-plugin/issues/8
[Why I Don't Recommend Aspect-Oriented Programming in Android in 2023]: https://jdvp.me/articles/AOP-in-Android-2023
[would not be broken]: https://github.com/Ibotta/gradle-aspectj-pipeline-plugin/issues/34
[desugaring]: https://android-developers.googleblog.com/2023/02/api-desugaring-supporting-android-13-and-java-nio.html | 4,801 | 1,156 | 645 | 66 |
momentumsuite/java-appium-testng-momentumsuite | momentumsuite | java-appium-testng-momentumsuite | https://github.com/momentumsuite/java-appium-testng-momentumsuite | false | Boilerplate project to run MOBILE Test Automation with TestNG, Appium, Allure reporting and Momentum Suite cloud device farm support | ['boilerplate'] | Apache License 2.0 | ['allure', 'allure-report', 'android-testing', 'appium', 'ios-testing', 'mobile', 'mobile-app', 'mobile-automation', 'mobileweb', 'mobven', 'momentumsuite', 'selenium', 'testng'] | 9,739 | Java | 2022-07-27T12:47:53 | 2023-03-08T09:31:23 | Boilerplate project to run MOBILE Test Automation with TestNG, Appium, Allure reporting and Momentum Suite cloud device farm support | 81,737 | 18,837 | 8,158 | 2,139 | 44 | 0 | 0 | 0 | 0 | 0 | 132 | 27 | 19 | 1 | Java Appium TestNG Momentumsuite
![image](https://user-images.githubusercontent.com/105457661/181139819-f73acae9-1a3b-4841-a536-983004d43cf1.png)
[TestNG](http://testng.org/) Integration with local or Momentum Suite real mobile farm devices
## Supports
* Native or Hybrid Android and iOS apps (APK, AAB, IPA)
* Chrome mobileweb testing on Android devices
* Safari mobileweb testing on iOS devices
* Parallel testing on multi mobile devices
* Local testing or using Momentum Suite's 150+ Android or iOS devices
* Auto generated HTML [Allure](https://docs.qameta.io/allure/) test report after test
## Info
* Branch to Appium 2.0 You can visit Click [here](https://github.com/momentumsuite/java-appium-testng-momentumsuite/tree/appium2)
## Setup
**Requirements:**
* Java 11+ If you don't have it installed, download it from [here](https://java.com/en/download/).
* Maven is required to run commands. Download it from [here](https://maven.apache.org/download.cgi).
* Install the [Allure command-line tool](https://www.npmjs.com/package/allure-commandline), and process the results directory after test run.
**Install the dependencies:**
Run the following command in project's base directory :
```
mvn clean
```
## Getting Started
Getting Started with Appium-Java tests on Momentum Suite couldn't be easier!
With a Momentum Suite account, You need 4 things to start without any Appium or Android SDK dependencies.
* **momentum:user** Usually it could be your email address
* **momentum:token** Your unique access token learned from momentumsuite.com
* **momentum:gw** Comma seperated Momentum Suite mobile device ID list (4 digit number) to run the test. First number will be your default phone for all except parallel-testing.
* **appium:app** Your uploaded IPA, APK or AAB app file from Momentum Suite Application Library. Example format is ms://<hashed-app-id> Optionally you can use a public accessible web URL.
Do not forget to set these 4 Appium capability values and check hostname, port, path and protocol values on your **testSettings.json** file.
**Start with Android device:**
Open for editing your testSettings.json file under [root directory](https://github.com/momentumsuite/java-appium-testng-momentumsuite/blob/main/src/test/resources/config/testSettings.json).
Set momentum.user, momentum.token, momentum.deviceList, momentum.app on testSettings.json file.
Test script is available in getting-started directory
Run the following command in project's base directory :
```
mvn clean test -P android-first
```
**Start with iOS device:**
Same with Android, but need to change testSettings.json file.
Run the following command in project's base directory :
```
mvn clean test -P ios-first
```
**Start with local testing:**
Use Local testing that access resources hosted in your development or testing environments. You need to install Appium and it's all dependencies like Android SDK, Xcode, Command Line tools. At the same sime you will need to run a real device or simulator/emulator. Do not forget to check hostname, port, path and protocol values on your test-settings.js file with your own Appium server.
Run the following command in project's base directory :
```
mvn clean test -P android-local
```
**All available commands to start mobile testing:**
```
mvn clean test -P android-first
mvn clean test -P android-local
mvn clean test -P android-parallel
mvn clean test -P android-chrome
mvn clean test -P ios-first
mvn clean test -P ios-local
mvn clean test -P ios-parallel
mvn clean test -P ios-safari
```
**Allure Reporting**
Run the following command in project's base directory after test run has been completed. This command will open a browser window with HTML test results.
```
allure serve allure-results
```
## Getting Help
If you are running into any issues or have any queries, please check [Momentum Suite Contact page](https://www.momentumsuite.com/contact/) or get in touch with us.
Our Technical Documentation space is [here](https://www.momentumsuite.com/docs/). | 4,061 | 963 | 537 | 81 |
mustafa01ali/SensorsSandbox | mustafa01ali | SensorsSandbox | https://github.com/mustafa01ali/SensorsSandbox | false | Android application to demonstrate how to work with onboard sensors in Android | ['demo'] | Apache License 2.0 | [] | 1,914 | Java | 2013-10-29T11:02:47 | 2023-12-22T07:11:23 | Android application to demonstrate how to work with onboard sensors in Android | 84,238 | 20,597 | 10,007 | 2,511 | 59 | 0 | 0 | 0 | 0 | 0 | 78 | 12 | 12 | 1 | Sensors Sandbox ![Build status](https://travis-ci.org/mustafa01ali/SensorsSandbox.svg?branch=master)
==============
Android application to demonstrate how to work with on-board sensors in Android. It displays the list of all the available sensors on your device, choosing one of them displays the data measured by the sensor in real-time using the Android SensorManager API.
<br />
<img src="/screenshot.png" height="700">
<br />
<a href='https://play.google.com/store/apps/details?id=com.mustafaali.sensorssandbox&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' width="200"/></a>
License
-------
Copyright 2013-2016 Mustafa Ali
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. | 1,409 | 328 | 147 | 19 |
pushy/pushy-demo-android | pushy | pushy-demo-android | https://github.com/pushy/pushy-demo-android | false | A demo of the Pushy Android SDK integrated into a sample Android app. | ['demo', 'sample'] | Apache License 2.0 | [] | 12,478 | Java | 2016-10-20T10:19:38 | 2023-05-24T10:55:28 | A demo of the Pushy Android SDK integrated into a sample Android app. | 91,227 | 22,799 | 9,191 | 2,325 | 54 | 0 | 0 | 0 | 0 | 0 | 69 | 15 | 13 | 1 | pushy-demo-android
A demo of the [Pushy Android SDK](https://pushy.me/docs/android/get-sdk) integrated into a sample Android app.
> [Pushy](https://pushy.me/) is the most reliable push notification gateway, perfect for real-time, mission-critical applications.
This app registers your device to receive push notifications and assigns it a unique token, which you can copy and paste into the [demo page](https://pushy.me/docs/resources/demo) to send yourself a test push notification.
## Links
* [APK File](https://github.com/pushy/pushy-demo-android/raw/master/app/app-release.apk)
* [Demo Page](https://pushy.me/docs/resources/demo)
* [Google Play Listing](https://play.google.com/store/apps/details?id=me.pushy.example)
## Screenshots
<img src="screenshots/1.png" width="250"> <img src="screenshots/2.png" width="250">
## Get Started
* Clone the repository locally
* Open `pushy-demo.iml` with Android Studio
* Build and run the demo application on either a physical device or emulator
* Copy the unique token from the device logcat and paste it into the [demo page](https://pushy.me/docs/resources/demo) to send yourself a test notification
## More Information
* [Pushy](https://pushy.me/)
* [Pricing](https://pushy.me/pricing)
* [Documentation](https://pushy.me/docs)
## License
[Apache 2.0](LICENSE) | 1,305 | 325 | 143 | 21 |
robertlevonyan/drag-and-drop-demo | robertlevonyan | drag-and-drop-demo | https://github.com/robertlevonyan/drag-and-drop-demo | false | A demo application to represent a drag and drop in Android | ['demo'] | Apache License 2.0 | ['android', 'android-app', 'android-application', 'android-development', 'android-sdk', 'android-studio', 'android-ui', 'kotlin', 'kotlin-android'] | 4,338 | Kotlin | 2020-07-12T04:52:40 | 2023-09-09T07:29:31 | A demo application to represent a drag and drop in Android | 67,582 | 20,044 | 7,620 | 1,905 | 55 | 0 | 0 | 0 | 0 | 0 | 58 | 11 | 11 | 1 | <img src="https://github.com/robertlevonyan/drag-and-drop-demo/blob/master/app/src/main/ic_launcher-playstore.png" width="50" height="50" /> Drag and Drop Demo
|A demo application to represent a drag and drop in Android|<img src="https://github.com/robertlevonyan/drag-and-drop-demo/blob/master/media/dragndrop.png" width="450" />|
|----------------------------------------------------------------------------------------------|-----------|
## How the app works
<img src="https://github.com/robertlevonyan/drag-and-drop-demo/blob/master/media/appflow.gif" width="500" />
Also I've created a small blog-post about Drag and Drop. You can read it [here](https://robertlevonyan.medium.com/drag-and-drop-in-android-all-you-need-to-know-6df8babfb507)
## Contact
- **Email**: [email protected]
- **Website**: https://robertlevonyan.com/
- **Medium**: https://medium.com/@RobertLevonyan
- **Twitter**: https://twitter.com/@RobertLevonyan
- **Facebook**: https://facebook.com/robert.levonyan
- **Google Play**: https://play.google.com/store/apps/dev?id=5477562049350283357
<a href="https://www.buymeacoffee.com/robertlevonyan">
<img src="https://github.com/robertlevonyan/drag-and-drop-demo/blob/master/media/coffee.jpeg" width="300" />
</a>
## Licence
```
MIT License
Copyright (c) 2021 Robert
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
``` | 2,341 | 569 | 249 | 37 |
scuzoutao/AndroidCrashProtect | scuzoutao | AndroidCrashProtect | https://github.com/scuzoutao/AndroidCrashProtect | false | 实现 looper 兜底机制的 demo,支持远程下载 crash 兜底的配置文件,出现 crash 时,通过对异常各种信息、app 和系统版本信息等来实现崩溃画像匹配,保护住之后还可以进行一些自定义操作,如 toast、清除缓存等 | ['demo'] | Apache License 2.0 | [] | 106 | Kotlin | 2023-11-03T07:30:01 | 2023-11-16T03:07:00 | 实现 looper 兜底机制的 demo,支持远程下载 crash 兜底的配置文件,出现 crash 时,通过对异常各种信息、app 和系统版本信息等来实现崩溃画像匹配,保护住之后还可以进行一些自定义操作,如 toast、清除缓存等 | 72,505 | 16,563 | 8,111 | 1,954 | 50 | 0 | 0 | 0 | 0 | 0 | 116 | 87 | 10 | 1 | AndroidCrashProtect
实现 looper 兜底机制的 demo,支持远程下载 crash 兜底的配置文件,出现 crash 时,通过对异常各种信息、app 和系统版本信息等来实现崩溃画像匹配,保护住之后还可以进行一些自定义操作,如 toast、清除缓存等
外部需要:
1. 实现 IApp 接口,提供相应操作的实现
2. 在 Application#onCreate() 中调用 CrashPortrayHelper#init
3. 自定义配置文件的下载、缓存、读取逻辑
实现思路参考:[Android稳定性:可远程配置化的Looper兜底框架](https://juejin.cn/post/7198466997288566842)
个人掘金主页:[邹阿涛涛涛涛涛涛的个人主页](https://juejin.cn/user/3808364009106839/posts)
# 核心代码:
## 按配置判断是否保护
```
fun needBandage(throwable: Throwable): Boolean {
if (crashPortrayConfig.isNullOrEmpty()) {
return false
}
val config: List<CrashPortray>? = crashPortrayConfig
if (config.isNullOrEmpty()) {
return false
}
for (i in config.indices) {
val crashPortray = config[i]
if (!crashPortray.valid()) {
continue
}
//1. app 版本号
if (crashPortray.appVersion.isNotEmpty()
&& !crashPortray.appVersion.contains(actionImpl.getVersionName(application))
) {
continue
}
//2. os_version
if (crashPortray.osVersion.isNotEmpty()
&& !crashPortray.osVersion.contains(Build.VERSION.SDK_INT)
) {
continue
}
//3. model
if (crashPortray.model.isNotEmpty()
&& crashPortray.model.firstOrNull { Build.MODEL.equals(it, true) } == null
) {
continue
}
val throwableName = throwable.javaClass.simpleName
val message = throwable.message ?: ""
//4. class_name
if (crashPortray.className.isNotEmpty()
&& crashPortray.className != throwableName
) {
continue
}
//5. message
if (crashPortray.message.isNotEmpty() && !message.contains(crashPortray.message)
) {
continue
}
//6. stack
if (crashPortray.stack.isNotEmpty()) {
var match = false
throwable.stackTrace.forEach { element ->
val str = element.toString()
if (crashPortray.stack.find { str.contains(it) } != null) {
match = true
return@forEach
}
}
if (!match) {
continue
}
}
//7. 相应操作
if (crashPortray.clearCache == 1) {
actionImpl.cleanCache(application)
}
if (crashPortray.finishPage == 1) {
actionImpl.finishCurrentPage()
}
if (crashPortray.toast.isNotEmpty()) {
actionImpl.showToast(application, crashPortray.toast)
}
return true
}
return false
}
```
# 实现保护,looper 兜底
```
override fun uncaughtException(t: Thread, e: Throwable) {
if (CrashPortrayHelper.needBandage(e)) {
bandage()
return
}
//崩吧
oldHandler?.uncaughtException(t, e)
}
/**
* 让当前线程恢复运行
*/
private fun bandage() {
while (true) {
try {
if (Looper.myLooper() == null) {
Looper.prepare()
}
Looper.loop()
} catch (e: Exception) {
uncaughtException(Thread.currentThread(), e)
break
}
}
}
``` | 12,234 | 1,120 | 255 | 122 |
vanniktech/TextBuilder | vanniktech | TextBuilder | https://github.com/vanniktech/TextBuilder | false | Provides a Class with a builder pattern for building beautiful text super easily. Internally it uses the Spannable API. | ['pattern'] | Apache License 2.0 | ['android', 'color', 'formatting', 'text', 'textview'] | 620 | Java | 2017-01-24T09:57:52 | 2024-01-12T06:04:09 | Provides a Class with a builder pattern for building beautiful text super easily. Internally it uses the Spannable API. | 77,477 | 19,740 | 9,333 | 2,401 | 59 | 0 | 0 | 0 | 0 | 0 | 119 | 23 | 19 | 1 | TextBuilder
===========
Provides a Class with a builder pattern for building beautiful text super easily. Internally it uses the Spannable API.
```java
new TextBuilder(this) // Context
.addText(R.string.some_text)
.addWhiteSpace()
.addColoredTextRes("in green", R.color.green)
.addWhiteSpace()
.addColoredText("and blue", Color.BLUE)
.addWhiteSpace()
.into(textView);
```
Also certain parts of a text can be formatted:
```java
new TextBuilder(this) // Context
.addFormableText("Terms of use and privacy terms")
.format("Terms of use")
.textColor(Color.RED)
.italic()
.bold()
.clickable(() -> Log.d(TAG, "Clicked on Terms of Use"))
.done()
.format("privacy terms")
.underline()
.bold()
.clickable(() -> Log.d(TAG, "Clicked on Privacy Terms"))
.done()
.into(textView);
```
Displaying images is also not a problem:
```java
new TextBuilder(this)
.addDrawable(R.drawable.ic_done_black_18dp)
.addWhiteSpace()
.addText("Shopping")
.addNewLine()
.addText("Cleaning")
.into(textView);
```
For now only the basic things are supported and some features may be lacking. I'm open for any suggestions or new APIs.
# Setup
**build.gradle**
```groovy
compile 'com.vanniktech:textbuilder:0.4.0'
compile 'com.vanniktech:textbuilder:0.5.0-SNAPSHOT'
```
Modules are located on [Maven Central](https://oss.sonatype.org/#nexus-search;quick~textbuilder).
# Proguard
No configuration needed.
# License
Copyright (C) 2017 Vanniktech - Niklas Baudy
Licensed under the Apache License, Version 2.0 | 1,587 | 421 | 162 | 53 |
vinchamp77/Demo_SimpleNavigationCompose | vinchamp77 | Demo_SimpleNavigationCompose | https://github.com/vinchamp77/Demo_SimpleNavigationCompose | false | Demo App - Jetpack Compose Navigation | ['demo'] | Apache License 2.0 | ['android', 'compose-navigation', 'jetpack-compose', 'kotlin'] | 974 | Kotlin | 2022-01-31T04:01:47 | 2023-07-04T01:40:45 | Demo App - Jetpack Compose Navigation | 76,039 | 19,384 | 8,744 | 2,300 | 53 | 0 | 0 | 0 | 0 | 0 | 37 | 8 | 6 | 1 | Simple Jetpack Compose Navigation Example
![](screenshots/Simple_Jetpack_Compose_Navigation_Example_01.gif)
## Requirements
- Android Studio Flamingo or later
## Tech Stack
- Jetpack Compose
- Navigation Compose
- Compose Destination
## Articles
- [Simple Jetpack Compose Navigation Example](https://vtsen.hashnode.dev/simple-jetpack-compose-navigation-example)
- [Compose Destinations - Navigation Library](https://vtsen.hashnode.dev/compose-destinations-navigation-library)
- [How to Add Bottom Navigation in Jetpack Compose?](https://vtsen.hashnode.dev/how-to-add-bottom-navigation-in-jetpack-compose)
- [How to Add Navigation Drawer in Jetpack Compose?](https://vtsen.hashnode.dev/how-to-add-navigation-drawer-in-jetpack-compose)
- [How to Add Deep Links in Jetpack Compose?](https://vtsen.hashnode.dev/how-to-add-deep-links-in-jetpack-compose)
## Branches
- [master](https://github.com/vinchamp77/Demo_SimpleNavigationCompose/tree/master) - Basic Compose Navigation
- [compose_destinations](https://github.com/vinchamp77/Demo_SimpleNavigationCompose/tree/compose_destinations) - Basic Compose Navigation (Using [Compose Destinations](https://github.com/raamcosta/compose-destinations/) library)
- [bottom_nav](https://github.com/vinchamp77/Demo_SimpleNavigationCompose/tree/bottom_nav) - Bottom Navigation
- [bottom_nav_drawer](https://github.com/vinchamp77/Demo_SimpleNavigationCompose/tree/bottom_nav_drawer) - Bottom Navigation + Navigation Drawer
- [deeplink](https://github.com/vinchamp77/Demo_SimpleNavigationCompose/tree/deeplink) - Deep Link Example
## License
```
Copyright 2023 Vincent Tsen
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
``` | 2,129 | 514 | 190 | 33 |
volcengine/APMPlus_Android | volcengine | APMPlus_Android | https://github.com/volcengine/APMPlus_Android | false | APMPlus Android Demo | ['demo'] | MIT License | [] | 148 | Java | 2020-12-06T03:34:57 | 2023-12-09T02:32:52 | APMPlus Android Demo | 68,234 | 18,052 | 7,401 | 2,249 | 53 | 0 | 0 | 0 | 0 | 0 | 20 | 5 | 3 | 1 | [ENGLISH](README-EN.md)
# APMPlusDemo
这是 APMPlus Sdk的使用示例. 下面链接有详细的Sdk接入和使用说明
1. [APMPlus Android 接入文档](https://www.volcengine.com/docs/6431/68852)
2. [APMPlus Android Q&A](https://www.volcengine.com/docs/6431/127838)
### Demo使用说明
1. 这个demo已经接入了所有APMPlus的性能和稳定性监控的能力。
2. 可以在这个demo里面模拟异常和性能数据收集上报。
3. 数据会上报到APMPlus平台,可以配置成自己项目的Aid进行SDK功能测试。
#### 注册并查看demo上报的数据
1. 在APMPlus平台注册一个账号。[注册地址](https://www.volcengine.com/products/apmplus)
2. 然后修改demo里的Aid进行测试。
### 开源许可协议
APMPlus_Android 使用 MIT 协议,具体内容查看 [LICENSE](LICENSE) | 516 | 270 | 36 | 14 |
Template Generation Dataset for AI Agents Evaluation
This is the benchmark for the Project Template Generation task, which requires creating a project template (content and structure) by short textual description.
The dataset provides all the required components for evaluation of project template generation approaches in real project templates collected from GitHub, including:
- Repository description;
- Repository root README.md file content;
- Repository link by which the "golden" template can be accessed;
- GitHub repository telemetry, including additional data and metrics that can be useful in developing new approaches.
All the repositories are published under permissive licenses (MIT, Apache-2.0, BSD-3-Clause, and BSD-2-Clause). The datapoints can be removed upon request.
The collected dataset was carefully filtered, enhanced with useful metrics and, what's more, manually labeled, which assures the data quality and provides a golden subset of good examples for evaluation.
Moreover, the dataset was split into several categories, namely:
Category | Description | Number of data points |
---|---|---|
py |
Repositories with Python main language | 565 |
java |
Repositories with Java main language | 81 |
kt |
Repositories with Kotlin main language | 19 |
android |
Repositories with Kotlin/Java main language based on Android sdk | 17 |
...and splits, namely:
Split | Description |
---|---|
dev |
All collected datapoints |
test |
Manually verified datapoints |
train |
Rest of the datapoint from dev without test |
The following sections describe the utilities around the dataset, as well as dataset content.
Dataset Collection
This dataset contains information about repos (initially gathered from https://seart-ghs.si.usi.ch) matching the following criteria:
Python
,Java
,Kotlin
programming languages- 10+ stars
- 10-1000 code lines
- updated after 2023-01-01 00:00
- not forks
- permissive licenses (
MIT License
,Apache License 2.0
,BSD 3-Clause "New" or "Revised" License
,BSD 2-Clause "Simplified" License
) - filtered by
is_template=True
or template-related keywords presence in the description (template
,boilerplate
,starter
,skeleton
,blueprint
,scaffold
,pattern
,seed
,example
,demo
,sample
,showcase
,illustration
,exemplar
,use case
,prototype
) - android is moved to separate category (by
android
keyword in description or repofill_name
)
You can find all scripts to reproduce dataset collection in our GitHub repository
Dataset Description
Field | Description |
---|---|
id |
Identifier of data point. |
full_name |
Repository full name {owner}/{name} . |
owner |
Bug issue repository owner. |
name |
Bug issue repository name. |
html_url |
GitHub link to issue https://github.com/{owner}/{name} . |
is_template |
True if the repositories marked as a template, otherwise False. |
description |
Repository description. |
template_keywords |
Template-related keywords. |
license |
Repository license (one from 'MIT License', 'Apache License 2.0', 'BSD 3-Clause "New" or "Revised" License', 'BSD 2-Clause "Simplified" License'). |
topics |
Repository topics. |
size |
Repo size [MB]. |
metrics |
Dict from languages to their meta info like lines count. |
languages |
Repo languages. |
language |
Repo main language. |
created_at |
Date of the repo was created in format of yyyy-mm-dd hh:mm:ss. |
updated_at |
Date of the last repo update in format of yyyy-mm-dd hh:mm:ss. |
code_lines |
Number of lines of code in repo. |
repo_symbols_count |
Number of symbols in the repository. |
repo_tokens_count |
Number of tokens in the repository. |
repo_words_count |
Number of words in the repository. |
repo_lines_count |
Number of lines in the repository. |
repo_files_count |
Number of files in the repository. |
repo_code_symbols_count |
Number of code symbols in the repository. |
repo_code_tokens_count * |
Number of code tokens in the repository. |
repo_code_words_count |
Number of code words in the repository. |
repo_code_lines_count |
Number of code lines in the repository. |
repo_code_files_count |
Number of code files in the repository. |
description_symbols_count |
Number of symbols in the repository description. |
description_tokens_count * |
Number of tokens in the repository description. |
description_words_count |
Number of words in the repository description. |
description_lines_count |
Number of lines in the repository description. |
readme |
Root README.md repository content. |
readme_symbols_count |
Number of symbols in the repository readme . |
readme_header_tokens_count * |
Number of tokens in the repository readme . |
readme_header_words_count |
Number of words in the repository readme . |
readme_header_lines_count |
Number of lines in the repository readme . |
* Tokens calculated via GPT-4 tokenizer
Dataset analysis
Dataset usage
- Load the data via load_dataset:
from datasets import load_dataset
# Select a configuration from ["java", "kt", "android"]
configuration = "java"
# Select a split from ["dev", "train", "test"]
split = "dev"
# Load data
dataset = load_dataset("JetBrains-Research/template-generation", configuration, split=split)
- Downloads last month
- 95