Explore all mobile app development open source, libraries, packages, source code, cloud functions and APIs.

Mobile app development is the act or process by which a mobile app is developed for mobile devices, such as personal digital assistants, enterprise digital assistants or mobile phones. These applications can be pre-installed on phones during manufacturing platforms, or delivered as web applications..

Explore Related Topics

Popular New Releases in Mobile

swift

Swift 5.6.1 Release

ionic-framework

v6.1.3-nightly.20220422

fastlane

2.205.2 Improvements

glide

Glide v4.13.1

AndroidUtilCode

1.30.0

Popular Libraries in Mobile

swift

by apple doticonc++doticon

star image 59304 doticonApache-2.0

The Swift Programming Language

ionic-framework

by ionic-team doticontypescriptdoticon

star image 46757 doticonNOASSERTION

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.

awesome-ios

by vsouza doticonswiftdoticon

star image 37808 doticonMIT

A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects

fastlane

by fastlane doticonrubydoticon

star image 34761 doticonMIT

šŸš€ The easiest way to automate building and releasing your iOS and Android apps

glide

by bumptech doticonjavadoticon

star image 32412 doticonNOASSERTION

An image loading and caching library for Android focused on smooth scrolling

AndroidUtilCode

by Blankj doticonjavadoticon

star image 29761 doticonApache-2.0

:fire: Android developers should collect the following utils(updating).

open-source-ios-apps

by dkhamsing doticonswiftdoticon

star image 29606 doticonCC0-1.0

:iphone: Collaborative List of Open-Source iOS Apps

leakcanary

by square doticonkotlindoticon

star image 27449 doticonApache-2.0

A memory leak detection library for Android.

lottie-web

by airbnb doticonjavascriptdoticon

star image 26512 doticonMIT

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/

Trending New libraries in Mobile

maui

by dotnet doticoncsharpdoticon

star image 14985 doticonMIT

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.

mvt

by mvt-project doticonpythondoticon

star image 6869 doticonNOASSERTION

MVT (Mobile Verification Toolkit) helps with conducting forensics of mobile devices in order to find signs of a potential compromise.

SmartTubeNext

by yuliskov doticonjavadoticon

star image 5225 doticonNOASSERTION

Ad free app for watching tube videos on Android TV boxes

accompanist

by google doticonkotlindoticon

star image 4677 doticonApache-2.0

A collection of extension libraries for Jetpack Compose

ControlRoom

by twostraws doticonswiftdoticon

star image 4440 doticonMIT

A macOS app to control the Xcode Simulator.

kraken

by openkraken doticontypescriptdoticon

star image 4419 doticonApache-2.0

A web standards-compliant, high-performance rendering engine based on Flutter.

secretive

by maxgoedjen doticonswiftdoticon

star image 4030 doticonMIT

Store SSH keys in the Secure Enclave

Pulse

by kean doticonswiftdoticon

star image 3994 doticonMIT

Logger and network inspector for Apple platforms

keen-slider

by rcbyr doticontypescriptdoticon

star image 3299 doticonMIT

The touch slider carousel with the most native feeling

Top Authors in Mobile

1

NativeScript

75 Libraries

star icon27638

2

microsoft

69 Libraries

star icon13343

3

PacktPublishing

62 Libraries

star icon831

4

MicrosoftDocs

62 Libraries

star icon140

5

ionic-team

47 Libraries

star icon67291

6

appcoda

47 Libraries

star icon1419

7

CyanogenMod

43 Libraries

star icon581

8

Apress

39 Libraries

star icon568

9

aaronksaunders

39 Libraries

star icon443

10

EddyVerbruggen

38 Libraries

star icon3191

1

75 Libraries

star icon27638

2

69 Libraries

star icon13343

3

62 Libraries

star icon831

4

62 Libraries

star icon140

5

47 Libraries

star icon67291

6

47 Libraries

star icon1419

7

43 Libraries

star icon581

8

39 Libraries

star icon568

9

39 Libraries

star icon443

10

38 Libraries

star icon3191

Trending Kits in Mobile

AR Core app allows users to experience augmented reality on their Android devices. This kit helps developers and users to experience their own 3d models.


The users have the liberty to choose their own 3d models with all the fun elements also. Please see below a sample solution kit to jumpstart your solution on AR App using Android Kit. To use this kit to build your own solution, scroll down to the Kit Deployment Instructions sections.

Development Environment

The Android Studio IDE is open source and used for this development. It has a rich UI development environment with templates to give new developers launching their innovations into Android development.

Android Libraries

ARCore is the advanced platform that enables Android app developers and users to quickly and easily build AR experiences into their mobile apps and games.

Google Sceneform is an open-source 3D framework that makes it easy for you to build ARCore apps.

Android-Gradle is the open-source Android framework used to develop AR projects.

AR Fragments are used to build these ARCore apps.

Instruction to Replace 3d Models

  1. To place your own 3d model, initially, you need to set up your Android studio with "Google Sceneform Tool (Beta)"
  2. To install Google Sceneform Tool just follow the below steps : a. Go to file > settings b. In settings, click on 'plugins' c. In plugins search for "Google Sceneform Tool" in Marketplace d. Once you find, Install and restart the Android Studio
  3. Place your 3d model obj and mtl file in sampledata folder in the application Note:- Name of the obj file should be in lowercase
  4. Make a raw folder under app > src > main > res > raw
  5. Right-click on the obj file and generate the Sceneform for your 3d model under the raw folder.

Support

If you need help to use this kit, you can email us at kandi.support@openweaver.com or direct message us on Twitter Message @OpenWeaverInc.

kandi 1-Click Install


Java Encryption Libraries enable password encryption, digital signatures, secure random number generation, message authentication, and 2FA. 


Encryption, decryption, and key generation are the three most crucial aspects of Java cryptography. Key-based data security can be enabled in two ways, using symmetric or asymmetric encryption algorithms, considering how secure the code needs to be. Moreover, developers can easily enable security functions directly into the code with the set of APIs available in the Java Cryptography Architecture (JCA). The JCA is the core of java encryption and decryption, hashing, secure random, and various other java cryptographic functions.


Check out the below list to find more trending Java encryption libraries for your applications:

tink  

  • Offers various cryptographic functions like encryption, digital signatures, and more.  
  • Provides an easy-to-use interface, simplifying the implementation of robust security measures.  
  • Follows best practices, minimizing the chance of security vulnerabilities in cryptographic operations.  

bc-java  

  • Provides various encryption, signatures, and hashing algorithms.  
  • Offers flexible options for cryptographic operations to suit various protocols.  
  • Seamlessly integrates into Java applications for strong security features.

jasypt  

  • Supports many encryption methods for tailored security.  
  • Seamlessly integrates encryption features into Java codebases.  
  • Allows easy setup of encryption configurations for different use cases.  

cryptomator  

  • Encrypts files before uploading them to the cloud, keeping data private.  
  • Can easily access encrypted files and work with your data as usual.  
  • Enables secure file storage and access from different environments.  

Aegis  

  • Offers authenticated encryption schemes, ensuring both data confidentiality and integrity.  
  • Provides a user-friendly and straightforward API for implementing cryptographic operations.  
  • Is lightweight and easy to carry, so it works well in limited environments or small systems.  

mockserver  

  • Facilitates creating mock servers for testing and simulating HTTP/HTTPS interactions.  
  • Setting precise expectations for requests and responses helps thoroughly test API interactions.  
  • Can save API requests to reuse in tests for accuracy and reproducibility.  

hawk  

  • Offers a strong MAC algorithm for verifying the integrity and authenticity of messages.  
  • Utilizes an authorization header to transmit authentication information, enhancing security securely.  
  • Works across various platforms and languages, allowing integration into different applications and systems.  

GDA-android-reversing-Tool  

  • Can learn about Android apps by analyzing them using reverse engineering.  
  • Helps analyze and break down the code of Android apps for inspection.  
  • The graphical interface makes it easy to use the reverse engineering features.  

wycheproof  

  • Enables testing cryptographic algorithms and libraries for known security vulnerabilities and weaknesses.  
  • Have many cryptography test cases to ensure it works well in different situations.  
  • Helps confirm if cryptographic implementations work well on different platforms and libraries.  

bt  

  • Can share files, reducing the need for central servers and speeding up downloads.  
  • To speed up downloads, it uses a method called "swarming." This method collects small pieces from many sources simultaneously.  
  • The protocol will download from other sources if a source is unavailable. This ensures that downloads are uninterrupted and strong.  

Peergos  

  • Provides strong file encryption, ensuring data privacy and security from unauthorized access.  
  • Users gain control over their data. They can securely share files and manage access permissions.  
  • It uses a network not centered in one place to save and find files. This makes it so we don't have to rely on one main server, which helps ensure the data is always there and strong.  

i2p.i2p  

  • Let users browse websites and send messages without showing their IP addresses.  
  • Uses powerful encryption to keep data safe and secure when it's sent.  
  • The routing mechanism is not centralized. This makes it difficult for others to track online activities.  

secure-preferences  

  • We use encryption to protect private information from people who shouldn't see it.  
  • It works with Android's SharedPreferences API. This means you can easily use secure data storage without changing much code.  
  • The app protects sensitive information, reducing the risk of data breaches or leaks. It enhances user privacy.  

AndroidWM  

  • Can add personalized watermarks to images, improving branding and ownership recognition.  
  • Can choose where the watermark goes, how big it is, how see-through it is, and what it looks like.  
  • Can process many images together, which makes it simpler to add watermarks to them.  

Cipher.so  

  • Can easily use native code for cryptography in Android apps.  
  • Optimized cryptographic algorithms for efficient and secure data encryption and decryption.  
  • Supports various encryption and decryption methods, enabling customization based on specific security requirements.  

conscrypt  

  • Uses many different ways to keep data safe when encrypted or sent.  
  • Offers up-to-date TLS and SSL protocol versions for secure network communication.  
  • Ensures compatibility with older Android versions, allowing applications to maintain security across devices.  

react-native-sensitive-info  

  • Can securely store sensitive information like passwords or tokens.  
  • Compatible with both Android and iOS, ensuring consistent security practices across different platforms.  
  • Utilizes encryption mechanisms to protect sensitive data from unauthorized access.  

android-storage  

  • Simplifies data storage and retrieval tasks in Android apps, promoting efficient data handling.  
  • Offers the option to encrypt files stored on the device, enhancing data security.  
  • Can focus on how things work instead of how things are stored.  

whorlwind  

  • Offer tools to protect data when stored and transferred, ensuring it stays safe.  
  • Supports various encryption algorithms for different security needs.  
  • Designed for use across various platforms, promoting consistent security practices.  

encrypt  

  • Enables encryption and decryption operations within Android applications.  
  • Supports many encryption algorithms, offering flexibility in choosing the appropriate method.  
  • Simplifies the process of implementing encryption-related functionalities.  

java-aes-crypto  

  • Offers AES encryption and decryption capabilities, a widely used symmetric encryption algorithm.  
  • Provides mechanisms for secure key generation and management within Java applications.  
  • Supports cryptographic modes that ensure both data confidentiality and integrity.  

Android-Goldfinger  

  • Facilitates fingerprint-based authentication and access control in Android apps.  
  • Enhances user security by integrating biometric authentication.  
  • Offers a user-friendly interface for integrating fingerprint-related functionalities.  

AESCrypt-Android  

  • Implements AES encryption and decryption for protecting sensitive data in Android applications.  
  • Provides straightforward methods for incorporating AES cryptography into your code.  
  • Enables users to store and transmit sensitive information securely.  

Secured-Preference-Store  

  • Enhances SharedPreferences with encryption, safeguarding sensitive user preferences.  
  • Offers a seamless way to integrate secure preference storage without extensive code modifications.  
  • Prevents unauthorized access to preference data by implementing encryption mechanisms.  

EncryptedPreferences  

  • Integrates secure storage mechanisms for sensitive preferences in Android apps.  
  • Implements encryption to prevent data exposure or tampering.  
  • Provides an API for easily incorporating encrypted preference storage in Android projects.  

FAQ

What are Java encryption Libraries, and what basic encryption capabilities do they provide?  

Java encryption libraries are tools used to improve data security in Java applications. They help implement cryptographic techniques. They offer:  

  • AES (Advanced Encryption Standard): Symmetric encryption for secure data transmission.  
  • RSA (Rivestā€“Shamirā€“Adleman): Asymmetric encryption for secure key exchange and digital signatures.  
  • Hashing Algorithms: Generate secure hash codes to verify data integrity.  
  • Digital Signatures: Authenticate data origin and verify integrity.  
  • Key Management: Generate, store, and handle encryption keys.  
  • SSL/TLS: Implement secure communication over networks.  
  • PGP (Pretty Good Privacy): Encrypt and decrypt data for privacy.  

   

How can password encryption be achieved using Java libraries?  

In Java, you can encrypt passwords using JCA or third-party libraries. Hashing algorithms, such as bcrypt and SHA-256, convert passwords into irreversible codes. To keep user credentials safe, adding salt and storing them securely is important. This helps to prevent attacks and maintain confidentiality.  

  

Are digital signatures supported by any of the Java encryption libraries?  

Yes, digital signatures are supported by various Java encryption libraries. Java Cryptography Architecture (JCA) libraries enable the creation and verification of digital signatures. They use algorithms like RSA for asymmetric encryption. Digital signatures are important in Java applications for secure communication and authentication. They ensure data is authentic, integral, and cannot be denied. Bouncy Castle and other Java libraries can help with digital signatures and cryptography.  

  

What is an encryption key, and how is it used to encrypt and decrypt data securely?  

An encryption key is a special code that turns normal data into secret code and back again. It decides how data is changed so only authorized people with the right key can see it. Strong key management is essential to maintain data security and prevent unauthorized access.   

Encryption keys are crucial for secure communication. Data is kept safe from unauthorized access. This happens when it's being transmitted or stored.  

  

Can you create a Message Authentication Code using a popular Java encryption library?  

Developers can use algorithms, such as HMAC from JCA, to implement MAC for security. The sender creates a code that receivers can check using a secret key. This process ensures data is correct and information is secure when sent.  

  

Is there an easy way to generate cipher text from plain text using a library written in Java?  

Java has libraries like JCA that help turn plain text into secret code. Developers can change plain text into cipher text. They do this by choosing an encryption algorithm, such as AES, and using a secret key. They can do this through straightforward method calls. Java applications can securely transmit and store data while keeping it confidential. Developers can easily add strong encryption using these libraries without needing complex coding.  

Two-factor authentication (2FA) is a multifactor security process where users must authenticate their identity with two different means. This ensures better protection of secured assets and information.

Traditional username and password combinations are prone to hacking and getting hacked has been on the rise. Implementing 2FA authentication will prevent hackers from accessing your accounts even if your password is stolen. 2FA is a recommended practice for securing all your online accounts and devices to protect sensitive information losses.

You will need a different set of components with features ranging from creating the secret codes, accessing and authenticating.

OTP:

Time-based One-Time Password involves generating a one-time password from a shared secret key and the current timestamp using cryptographic algorithms. These libraries will help you generate secrete one-time passwords

SMS

Typically the OTP codes are sent to the user's mobile phone using SMS. This also helps to validate the user's mobile number correctness. The user can then enter the secret code into the application to complete the multifactor authentication. The below libraries will help in sending SMS from your application.

Email

The unique generated one-time password is sent via email to the user. The user uses the code from the email and enters the code into the application to confirm the authentication.

Biometric Authentication

Using Biometrics for authentication has been made easy with mobile devices. Biometrics can include different choices, such as using fingerprints, voice, and face as the secondary authentication mechanism.

Push Notifications

Typically, push notifications are sent to your mobile app to authorize login requests. It will include the details of the access device details and once authorized, the login to the application is allowed. Below libraries help in implementing the push notification-based authorization.

Animation is one of the most interesting features in an application. It's not a new thing, but it's something that you can use to make a difference to your app.


Animation has been around for some time now, and with the evolution of computers and technology, animation has become even more popular. A library of animation classes that can be applied to game object properties such as position, rotation, and scale, with a focus on keeping core classes small and efficient, while still being able to animate many different types of parameters. Animations bring to life the website and make it look more appealing to the visitor. Build interactive C# applications, animate elements, elegant UI effects. Listed here the best C# Animation libraries in 2022.

Deform  

  • Deform generally refers to the process of changing the shape or structure of things.  
  • This can involve stretching, compression, bending, or twisting.  
  • This deformation is often used to create realistic movement and simulate natural behaviors.  

ParticleEffectForUGUI  

  • ParticleEffectForUGUI displays particle effects specifically for Unity's UI system.  
  • Unity's UGUI is a system for creating user interfaces and integrating particle effects.  
  • In Unity's Hierarchy window, right-click and select Effects > Particle System.  


XamarinCommunityToolkit  

  • The Xamarin is an open-source project designed to provide a collection of controls.  
  • It controls helpers and abstractions for Xamarin.Forms applications.  
  • The Xamarin Community Toolkit aims to simplify the development process. It offers a set of reusable and customizable UI components and utilities.  


dotween  

  • DOTween is a popular animation engine for Unity, a game development framework.  
  • It provides a easy and efficient way to create tweens and animations in Unity projects.  
  • DOTween simplifies the process of creating animations by providing clean APIs.  

  

FancyScrollView  

  • Fancy Scroll View refers to a UI framework/library for Unity that provides a flexible.  
  • It's particularly useful for creating sophisticated and visually appealing scrollable lists or grids.  
  • The Fancy Scroll View library enhances Unity's standard ScrollView with additional features. 


LottieXamarin  

  • Lottie Xamarin library allows developers to use Lottie animations in Xamarin.  
  • Lottie is an open-source animation tool by Airbnb that renders Adobe Effects animations.  
  • Lottie animations can include complex vector graphics and are scalable.  

  

KvantSpray  

  • Kvant Spray is a Unity Asset with a particle system for creating dynamics.  
  • KvantSpray generates particle effects, particularly those resembling sprays or dynamics.  
  • The asset likely allows developers to create interactive and dynamic spray effects.  

  

PuppetTest  

  • PuppetTest helps to describe the process of writing and running unit tests for plans.  
  • Plans are Puppet code blocks that can run commands, scripts, tasks, and other plans.  
  • PuppetTest can also be the name of a codeless end-to-end test automation tool built on top of Puppet.  


Render-Crowd-Of-Animated-Characters  

  • Render-Crowd-Of-Animated-Characters is a GitHub project by Jiadong Chen.  
  • It demonstrates animation maps and GPU instancing usage to render thousands of animates.  
  • The project also supports shadows, AR Foundation, and URP (SRP Batcher).  


XamlFlair  

  • Xaml Flair likely refers to a library or framework related to Xamarin. Forms and XAML.  
  • It aimed to simplify the process of incorporating animations into Xamarin.Forms applications.  
  • It may offer a variety of animation effects and options, such as fade-ins, scale animations, etc.  


LeanTween  

  • LeanTween is a popular tweening engine for Unity as a used game development platform.  
  • It involves generating intermediate frames between two keyframes to achieve a smooth.  
  • LeanTween is easy to use and integrates seamlessly with Unity.  

KvantGrass  

  • KvantGrass uses shaders to render grass, allowing for efficient and visually pleasing.  
  • The system often includes a dynamic wind simulation feature.  
  • This adds realism to the grass rendering.  


SimpleAnimation  

  • A simple Animation Component that leverages PlayableGraphs in Unity.  
  • Simple animation uses basic techniques such as frame-by-frame.  
  • Simple animations are often used for educational, entertainment, or artistic purposes.  


facial-ar-remote  

  • Facial AR Remote is a tool that helps to capture blend shape animations from your iPhone X into a 3D App.  
  • Developed by Unity Technologies, it is an experimental project to explore it.  
  • This project is discontinued and replaced by the Live Capture package.  


Unity-Runtime-Animation-Recorder  

  • Unity-Runtime-Animation-Recorder is a GitHub project that allows you to record animations in Unity.  
  • Developed by Newyellow, it is a Taiwanese game developer, as a personal project.  
  • It explores the possibilities of real-time animation in Unity.


animation-jobs-samples  

  • Animation-jobs-samples is a GitHub project that contains code samples using the animation C#.  
  • Unity is a cross-platform game engine that creates interactive 3D and 2D content.  
  • The animation C# jobs feature enables you to write custom animation jobs in C# that can run on many threads.  


SpriterDotNet  

  • SpriterDotNet is a library for integrating the Spriter animation system with Unity games.  
  • Spriter is a 2D animation tool that allows artists to create modular animations.  
  • SpriterDotNet is a bridge between Spriter and Unity, making it easier to use Sprit


FAQ  

1. What is a C# Animation Library?  

The C# animation library is a set of tools, classes, or functions written in C#. That enables developers to create and manage animations in their applications and games. Animations are visual effects that change the appearance or position of an object. The C# animation libraries help with various purposes, such as game development, etc.  

  

2. What are Tweening Libraries in C#?  

Tweening libraries help interpolate between two values over time, creating transitions. They are often used in animation for movements, fades, and other effects. Tweening is a common technique in animation, game development, and user interface design. It can create realistic and dynamic effects with minimal code.  

  

3. What is the Difference Between Skeletal and Frame-by-Frame Animation?  

Skeletal animation involves moving predefined bone structures, while frame-by-frame animation. It involves creating individual frames for each animation state. Skeletal animation is often more flexible and efficient.  

  

4. Are There Performance Considerations When Using Animation Libraries?  

Yes, performance can be a consideration. Efficient coding practices and choosing libraries optimized for performance impact applications. Some animation libraries may claim to have better performance than others. Therefore, you should always measure the performance of your animations. Those tools such as Chrome DevTools, Lighthouse, or WebPageTest.  

  

5. What is the Role of Animation Jobs in Unity?  

Animation Jobs in Unity enable the parallel execution of animation tasks. It improves performance by utilizing multi-threading. Animation jobs are a low-level API that gives you direct access to the animation data stream. They are aimed at developers who want to have more control and flexibility over their animation.  

  

Globally, there are 2.2 billion people with vision impairment. They are facing constant challenges like navigating from one place to another on their own. They are dependent on another individual for accessing their basic day-to-day needs. So, it's a pretty challenging task. You can customize and use the following libraries to develop applications for guiding visually impaired people to move places. The application will show the visually impaired user the object's name, direction, and distance around them and help them navigate. Following are the steps to be followed for building the solution, 1. Object Detection 2. Accessing Cameras 3. Image Processing 4. Measuring the Distance

Accessing the Cameras

These libraries are used to access the camera for taking images for object detection.

Measuring the Distance

These libraries are used to measure the distance between camera and object.

Object Detection

These libraries are used to detect the objects in the image.

Image Processing

These libraries are used to process the captured image.

Data validation is a necessary step that allows for saving time and effort of a user when filling out forms on the web. Verify the field in two ways. 


By using built-in HTML elements (which have limited custom validation capabilities) or by using JavaScript validation libraries. JavaScript libraries provide pre-coded packages, which support legacy browsers that do not have a built-in validation framework. One major advantage of using JavaScript libraries is that it takes the extra load of data verification and error return off from the server-side. This enhances user experience and smoothens out the form-filling process. 


Listed below are some of the most popular form validation libraries based on JavaScript. The JSON-schema-validator is a code package that focuses on form field correctness and efficiency. AwesomeValidation is another JavaScript-based form validation library developed for use in Android, shrinking down validation to three steps only. Epubcheck is a code-package developed specifically for validation in e-book format files. Use these libraries to develop a flawless form on a web application.

android-saripaar  

  • Saripaar is a validation library for Android that allows you to add form validation.  
  • It provides a simple and extensible API for adding validation rules to your UI component.  
  • Saripaar uses annotations to define validation rules for your UI components.  

json-schema-validator  

  • JSON Schema is a standard for defining JSON data structure.  
  • JSON is a process that ensures that JSON data complies with a specified schema.  
  • It's a Java implementation of the JSON Schema specification and provides features.  


validator  

  • Validators are tools or components that ensure that data or input adheres to rules.  
  • JavaScript frameworks like Angular and React often have built-in forms.  
  • This can include data types, lengths, and constraints.  


epubcheck  

  • EPUBCheck is a tool used to validate EPUB-Electronic Publication files.  
  • EPUB is a digital eBook format widely used for eBooks, digital magazines, and others.  
  • EPUBCheck can catch errors and issues that might affect the display or functionality.  


AwesomeValidation  

  • AwesomeValidation is a validation library for Android that makes it easy to verify.  
  • It's designed to be easy to use and integrate into your Android projects.  
  • The library provides a variety of pre-defined validation rules and allows to create


simple-java-mail  

  • Simple Java Mail simplifies sending emails in Java applications.  
  • It provides a high-level API for composing and sending emails.  
  • This library aims to make email handling in Java straightforward to use.  


VerticalStepperForm  

  • The VerticalStepperForm is a UI component used in Android development to install it.  
  • It allows users to progress through a series of steps, entering information or making it.  
  • This type of UI is commonly used in onboarding processes, setup wizards, or any scenario.  


fluent-validator  

  • Fluent Validator is a Java library that provides a fluent interface for building.  
  • It makes validation code more expressive and readable by allowing it to chain.  


governator  

  • Governator is a library for building and managing Java applications.  
  • The name Governator plays on the words Guice and governance.  
  • It supports dynamic configuration updates without requiring a restart.  

  


json-schema  

  • JSON Schema is a specification for describing the structure of JSON data.  
  • It defines the elements that may appear in a JSON document and their relationships.  
  • It describes the expected structure and constraints of other JSON documents.  

  


android-submit-credit-card-flow  

  • It creates a credit card submission flow in an Android app that involves collecting it.  
  • This usually includes fields for the card number, expiration date, and CVVs.  
  • This ensures to handle sensitive information securely on a server that complies.  


kafka-spark-consumer  

  • This is a combination of Apache Kafka and Apache Spark. It is a popular architecture for processing and analyzing.  
  • Kafka acts as a distributed message broker, and Spark helps with stream processing  
  • This involves installing Kafka, starting a Kafka broker, and creating Kafka topics.  


Masked-Edittext  

  • A Masked EditText is a specialized form of an EditText in Android that enforces a specific input.  
  • It's commonly used when you want to guide users in entering data in a certain way.  
  • There are various libraries available in the Android ecosystem that provide Masked EditText.  


yavi  

  • Yavi focuses on providing a simple and expressive API for validating objects.  
  • Yavi is type-safe, which means it leverages Java's type system to catch it.  
  • This allows developers to create concise and readable validation code.  

docs-archive  

  • docs-archive is a Java library used in User Interface, Form, and Xamarin applications.  
  • It has no vulnerabilities, and it has low support.  
  • It has a neutral sentiment in the developer community.  


dss  

  • A Digital Signature Service (DSS) is a system or service that provides the capability.  
  • Digital signatures are cryptographic techniques used to verify authenticity and integrity.  
  • They ensure the security of electronic transactions and documents.  


android-validation-komensky  

  • android-validation-komensky is a Java library typically used in Utilities Validation applications.  
  • It has no vulnerabilities and has a build file available.  
  • It has a Permissive License, and it has low support.  

  


HtmlBuilder  

  • It's associated with a programming concept or library that helps in building HTML.  
  • HtmlBuilder is a Java library typically used in Mobile and Android applications.  
  • HtmlBuilder has no bugs or vulnerabilities.  


Android-Validator  

  • Android-Validator is a library for Android development that provides functionality for validating input.  
  • This library simplifies adding validation to Android forms by providing it.  
  • The library allows you to create custom validation rules by implementing the Rules.  


ParticlesDrawable  

  • ParticlesDrawable is an open-source library for Android that draws random flying particles.  
  • It has no vulnerabilities; it has built files available.  
  • ParticlesDrawable code analysis shows 0 unresolved vulnerabilities.  


FormsFX  

  • FormsFX is a Java library for building forms in JavaFX applications.  
  • It simplifies the process of creating and handling forms by providing a set of utilities.  
  • The library supports data binding, allowing you to bind form components to data.  


json-schema-validator  

  • JSON Schema Validator refers to a tool or library that validates JSON data against a JSON.  
  • JSON Schema is a standard defining the content, structure, and format of JSON form.  
  • It provides a way to describe the expected properties, their types, and constraints.  


xssValidator  

  • XSS is a security vulnerability that occurs when an application allows untrusted input.  
  • To mitigate XSS attacks, input validation and proper output encoding are crucial.  
  • Ensure that input adheres to expected formats and does not contain malicious content.  


android-json-form-wizard  

  • Android Material Json Form Wizard is a library for creating beautiful form-based wizards.  
  • Developed by Vijay Rawat, it is available on GitHub.  
  • The library creates form-based wizards with ease and speed, and it is based on the Material


rave  

  • RAVE is a Microsoft service that provides a platform for hosting and managing virtual events.  
  • Rave has no vulnerabilities and has built-in files available.  


data-binding-validator  

  • Data Binding Validator is an Android library that provides a quick way of validation.  
  • The library offers a range of validation types, such as minimum/maximum length.  
  • data-binding-validator is a Java library typically used in Utilities and Validation applications.  


android-card-form  

  • Android Card Form is a library that provides a ready-made card form layout used in an Android App.  
  • Developed by Braintree, it is available on GitHub.  
  • The library is open-source and free to use.  


FAQ

1. What is Java form validation?  

Java form validation ensures that the data entered meets the criteria. It helps maintain data integrity and improve the user experience by preventing invalid.  

  

2. How does form validation work in Java applications?  

Java form validation typically involves defining rules or constraints for each form field. Validation libraries provide annotations, APIs, or configuration options to express these rules. The validation framework checks the input against the defined rules and reports.  

  

3. Can I use annotations for form validation in Java?  

Yes, many Java form validation libraries, such as Hibernate Validator and Spring Validation. Annotations apply to fields or methods within Java beans to specify constraints. It required fields of maximum length or custom validation logic.  

  

4. Are there any lightweight form validation libraries for Java?  

Yes, there are lightweight validation libraries like Yavi. It aims to provide a simple and expressive API for validation without introducing. It focuses on being lightweight and efficient.  

  

5. Are Java form validation libraries suitable for client-side validation?  

Java form validation libraries primarily focus on server-side validation. For client-side validation, it may use JavaScript-based validation libraries. This is used in conjunction with server-side validation to provide a seamless.  

Buttons are essentially the drivers of online interaction as we use them to login into our emails, add products to our shopping carts, download photos and basically confirm any and all actions. But more than that, every button click is a successful conclusion of every front-end web developerā€™s hard work. Thatā€™s why it is crucial to spend time creating functional buttons that both look beautiful and provide visual cues to the user. JavaScript offers a ton of great button libraries for you to choose your essential UI components from. Here are some of the JavaScript libraries for buttons including Semantic-UI - UI component framework based around useful principles; Buttons - A CSS button library built using Sass and Compass; Ladda - Buttons with built-in loading indicators. The following is a comprehensive list of the best open-source JavaScript Button libraries in 2022

Why is Facebook is rebranding itself to focus on the metaverse? 7 years after its billion-dollar acquisition of Oculus, Facebook is pivoting itself towards virtual reality. While the earlier acquisitions of Instagram and WhatsApp successfully extended social engagement, metaverse is a much bigger bet. While metaverse looks like VR in a new bottle at some levels, betting the company's future on metaverse shows a strategic intent. It was interesting to see Microsoft announce immersive experiences on MS Teams. Multiple metaverses exist today in individual 3D gaming platforms and VR platforms. We are seeing companies fighting it out for cloud and AI platform dominance. Could Meta be positioning itself to own the user engagement channel in a new way? If users move towards using VR as a primary engagement model, this can pay off well. While this will play out over the decade or more, there are multiple low-hanging fruits to build mixed reality experiences into your applications. The kandi kit on Mixed Reality Solutions showcases popular open source libraries across AR, dedicated VR platforms, and device-specific solutions. Get ready for the next platform war!

Web Focused AR and VR Solutions

Virtual Reality Platforms

Virtual Reality Headset Focused Solutions

Safety is a major issue all around the world. We are living in the fastest and growing digital world. We are yet to ensure safety for women. The crimes against women are increasing day by day. We should bring those crimes to an end, and they should be protected. In recent days more applications are developed based on voice recognition to protect women from harassment. Some of these libraries can help you build an application for this solution.

Here is a list of the best Swift/iOS animation libraries for 2023 that developers can use to create immersive animations for mobile app development.


Animations can make a huge difference in user experience. Animation Libraries are a great way to add dynamic animations to the app. Correctly implemented, functional, beautiful animations are a joy for users and will help keep them engaged in the app. These libraries cover everything from user interface design to app analytics in a way that makes it very easy to implement animation in projects.


We have curated a list of the ten best Swift/iOS animation libraries that each provide a unique function.

Lottie-web 

  • Useful in adding animated icons and illustrations.
  • Helps load animations.
  • Helps in animated backgrounds.

react-motion 

  • Allows beautiful animations and transitions with a simple syntax.
  • Customizes the timing and duration of animations.
  • Helps in creating complex animations and transitions with ease.

Hero 

  • Helpful in custom navigation transitions.
  • Helps in creating interactive animations when tapping on views.
  • Helps in creating personalized presentation transitions.

SkeletonView 

  • Represents the structure of the UI.
  • Helps in customizing the look of the skeleton screens.
  • Creates empty screen animations.

ViewAnimator

  • Helps in animating views with ease.
  • Allows customizable animations with different directions, delays, and durations.
  • Helps in combining multiple animations for complex effects.

SwiftMessages

  • Allows custom in-app notifications to come up with animations.
  • Allows customizable designs for alerts and banners.
  • Shows toast notifications.

LiquidLoader.

  • Creates a Fun, liquid-style loading animation.
  • Allows customizable animations with different colors and shapes.
  • Helps in modifying loading animations for buttons and UI elements.

AnimatedCollectionViewLayout 

  • Customizes the animation style and direction.
  • Helps in supporting different types of cells.
  • Creates 3D effects.

LNZCollectionLayouts 

  • Has custom collection view layouts for unique designs.
  • Allows supporting different layout styles, such as circular and spiral.
  • Provides dynamic resizing and animation of cells.

Shimmer

  • Helpful in table view and collection view loading animations.
  • Used for empty screen placeholder animations.
  • Mimics the look of reflective surfaces.

Here are some of the Android Animation Libraries. Some of the use cases of Android Animation Libraries include Creating complex UI elements, enhancing user experience, enhancing game development, and Creating app-specific animations. 


Android Animation Libraries are collections of code libraries and tools for creating and animating graphics for Android applications. The libraries include a variety of animation techniques, such as keyframing, and physics-based animation, which can be used to create dynamic and interactive visual elements. 


Let us look at the libraries in detail below. 

rebound 

  • Uses a spring physics model to create animations. 
  • Designed to be used with the Android UI toolkit. 
  • Highly customizable. 

lottie-android 

  • Highly efficient and supports vector-based animations. 
  • Compatible with both Android and iOS devices. 
  • Allows you to create complex animations with a few simple lines of code

Android-Animation-Set 

  • Has no bugs, has no vulnerabilities. 
  • Has a Permissive License and it has medium support. 
  • Used in Telecommunications, Media, Telecom, User Interface, Animation applications. 

recyclerview-animators 

  • Uses less memory and fewer resources than other animation libraries. 
  • Allows you to tweak and customize the animations to suit your needs.  
  • Has built-in support for a range of animations, including alpha, translate, rotation, and more.  

ViewAnimator 

  • Allows developers to mix and match different animations to create complex effects.   
  • Has excellent documentation and a wide range of tutorials available. 
  • Animations created can be reused in multiple activities or applications. 

Swirl 

  • Doesnā€™t require a lot of setups and is easy to use.  
  • Provides a wide range of customization options.  
  • Has a powerful timeline feature that enables developers to animate objects across a timeline in a single line of code. 

Animated-icons 

  • Require less memory than many other animation libraries, making them ideal for mobile applications. 
  • Have a smaller code base than most other animation libraries. 
  • Are designed to be responsive, so they will resize and adapt to different screen sizes.

RxAnimation 

  • Create animations that span multiple platforms, including iOS and Windows. 
  • Able to create animations that are synchronized with user input.  
  • Allows developers to create custom animations according to their specific needs.  

Top libraries for integrating and working with IOS push notifications down here. You can reuse them modularly in your apps and websites to include push notification services.  


A message on an Apple device like an iPhone is an iOS push notification. iOS device users must expressly consent to receive push notifications from an app. Publishers of mobile apps can send push notifications to consumers' mobile devices if they opt in. Additionally, receiving them does not need iOS users to be in the app or using their smartphones at the time. The app can generate notifications locally or remotely by a server you govern. Local notifications use events, such as a time or place, to generate notice content and start the notification delivery. Your company's server generates push notifications for remote notifications, and Apple Push Notification Service (APNs) manages the delivery.   


The most rated IOS push notification libraries are listed below to ease the process of push notification integration for the developers. 

gorush- 

  • Micro-server using GIN framework written in Golang (Go) language. 
  • Supports command-line and Web API to send push notifications. 
  • If the server answer fails, the notification can be resent. 

react-native-push-notification- 

  • Local and Remote notifications using React-Native and Java. 
  • Custom sounds can be added to our notifications. 
  • Can check if a channel exists and delete channels if needed.

PushSharp- 

  • A library aiming the server-side functionalities. 
  • Can send push notifications to both IOS and OSX. 
  • Can also send customizable notifications to Android, windows, etc. 

apns2- 

  • Supports new Apple Token-Based Authentication (JWT). 
  • Simple, flexible, and can push mutable notifications. 
  • Is a Go package using the new HTTP/2 Push provider API.

PushNotifications- 

  • An app used for testing push notifications on iOS and Android. 
  • Support using certificate and token for authentication with APNS. 
  • It has auto-save settings. 

pushy- 

  • A java library to send APNs to push notifications. 
  • Is asynchronous and supports industrial-scale applications. 
  • Efficient in maintaining multiple parallel connections for sending many notifications simultaneously. 

react-native-onesignal- 

  • A free email, sms, push notification, and in-app message service for mobile apps. 
  • Specifically for pushing One-signal notifications in IOS. 
  • Developed using React-Native (Typescript). 

grocer- 

  • The most extensible interface with the Apple Push Notifications. 
  • Is built completely using Ruby. 
  • Is advisable to reuse the same connection to send multiple notifications.

fcm-django- 

  • Django app for Firebase Cloud Messaging.  
  • Used as a unified platform for sending push notifications to mobile devices & browsers. 
  • Admin actions for testing single and bulk notification sending.

Here are some of the famous Swift XML Libraries. The use cases of these libraries include: 

  • Parsing XML data into objects. 
  • Generating XML documents. 
  • Validating XML documents. 
  • Transforming XML documents. 
  • Querying XML documents.  


Swift XML libraries allow developers to work with XML data in the Swift programming language. Some popular Swift XML libraries include XMLCoder, SwiftSoup, and AEXML. These libraries may provide classes and methods to parse, serialize, and traverse XML documents and methods to create and manipulate XML documents.   


Let us look at some of these famous libraries. 

SwiftSoup

  • Offers a full-featured API for navigating and manipulating HTML documents.
  • Supports a variety of HTML5 elements and attributes.
  • Has a robust test suite that ensures the accuracy and correctness of the library.

BonMot

  • Offers integrated support for internationalization and localization.
  • Allows for custom styling and formatting of strings
  • Offers an easy-to-use templating engine, allowing developers to quickly and easily create complex XML documents.

SwiftRichString

  • Supports multiple output formats, including JSON, HTML, and plain text.
  • Supports both attribute- and element-level parsing, giving developers the flexibility to choose the level of detail they need.
  • Allows developers to customize the parsing process easily, giving them full control over the output. 

Kanna

  • Supports both DOM and SAX parsing.
  • Offers extensive error checking and debugging options.
  • Enables efficient searching and filtering of XML documents.

Plot

  • Features a powerful styling system that allows developers to quickly style their layouts with just a few lines of code.  
  • Supports custom node types, allowing developers to create custom nodes and use them in layouts.  
  • Provides a built-in animation system that can easily animate UI changes. 

SwiftSVG

  • Is an open-source library and is actively maintained, making it easier to keep up with the latest features and changes.
  • Is optimized for performance and scalability, making it suitable for large-scale projects.
  • Can generate SVG documents from scratch, making it easier to create complex visuals.

SWXMLHash

  • ļ»æSupports namespace prefixes for easy lookup of elements.
  • Allows developers to extract values from XML documents.
  • Allows developers to for specific tags, attributes and values.

Fuzi

  • ļ»æIs designed to be memory efficient, allowing the user to process large XML documents without too much memory.  
  • Uses lazy loading and caching to ensure fast and efficient parsing of XML documents.  
  • Offers comprehensive documentation, tutorials, and examples to help the user get started quickly. 

AEXML

  • ļ»æProvides a functional programming interface for transforming XML documents.
  • Supports both Objective-C and Swift code.
  • Provides an easy way to convert XML documents to JSON and vice versa.

EVReflection

  • An intuitive dot syntax for accessing and setting properties in an XML document is included.   
  • Support for multiple data types, including objects, arrays, and dictionaries. 
  • Is written in pure Swift, making it easy to integrate into existing Swift projects. 

A React Native dropdown library is a powerful tool. It provides developers with various dropdown functionalities for their mobile applications. It simplifies creating dropdown menus, search boxes, autocomplete search boxes and popup lists. It helps to offer various features and options. By incorporating a component into their projects, developers can enhance the user experience. They can also improve usability. 


Different dropdown types are available, ranging from basic lists to complex components. These include scroll and vertical scroll indicators, allowing users to navigate long lists. Additionally, multi-select dropdowns enable users to make many selections, offering greater flexibility.   


React Native dropdown libraries come equipped with various features that enhance their functionality. Sorting options help to organize dropdown options alphabetically or based on custom criteria. Pagination allows developers to display limited options. It helps in improving performance when dealing with large datasets. We can populate the dropdowns with values from the state variable by utilizing data binding. It helps ensure real-time updates.  


Design the library to be easy to implement and integrate into existing components. When creating a native dropdown library must focus on usability and user feedback. Consider incorporating visual cues to improve the look and feel.  


Integrating React native dropdowns into user interfaces is a versatile process. We can use navigation as part of a component to navigate between screens. They can function as standalone components. It allows developers to incorporate them into any part of their application.  


To maximize the potential of dropdowns must consider their diverse use cases. It can be from scenarios like selecting an option from a dropdown menu to complex situations. The situations can be filtering data based on user input. The react native dropdowns provide a flexible solution.


Developers can create interactive dropdowns by leveraging the useState hook and picker functionality. It can offer an excellent user experience.  

In summary, react native dropdown libraries are valuable to any mobile application. They provide many functionalities, including dropdown menus, search boxes, and popup lists. By incorporating these components, developers can enhance usability. It helps improve data handling and offers a seamless user experience. Remember to design the library and consider user feedback. It will follow best practices to create a robust and user-friendly dropdown solution.  


By utilizing React native dropdowns, developers can create engaging and intuitive interfaces. It will meet the requirements of its users. Whether it's a dropdown menu or search functionality, these libraries offer versatility. It helps accommodate a variety of use cases. By investing time into implementing high-quality dropdowns, developers can elevate their applications. It will deliver an exceptional user experience.  

react-native-dropdownalert:  

  • It provides a dropdown notification/alert component.  
  • It is useful for displaying informative or error messages in a dropdown style.  
  • It supports the customization of alert styles, animations, and duration.  
  • We can use it for implementing dropdown-based notifications or alerts.  

react-native-popup-menu:  

  • It helps create customizable popup menus with dropdown functionality.  
  • It is useful for displaying context menus or extra options in a dropdown format.  
  • It supports various popup menu styles, including dropdowns, tooltips, and more.  
  • We can use it for implementing dropdown menus in complex UI scenarios.  

react-native-modal-dropdown:  

  • It helps create dropdown menus that display as modal popups.  
  • It is useful for conserving screen space when dealing with long lists of options.  
  • It supports custom styling and animations for the dropdown modal.  
  • We can use it for implementing dropdowns where we prefer overlaying the content.

react-native-dropdown-picker:  

  • It helps create dropdown menus with customizable options.  
  • It is useful for creating multi-level dropdowns for selecting hierarchical data.  
  • It supports the customization of dropdown styles and animations.  
  • We can use it for implementing dropdown filters in search functionality.  

react-native-material-dropdown:  

  • It provides a dropdown component with a material design style.  
  • It is useful for creating dropdowns that conform to the Material Design guidelines.  
  • It supports both single and multi-select dropdowns.  
  • We can use it for implementing form inputs with dropdown selections.  

react-native-wheel-picker:  

  • It helps create dropdowns using a wheel picker style.  
  • It is useful for creating dropdowns with a spinning wheel-like interface.  
  • It supports customizable options for wheel styling, item selection, and event handling.  
  • We can use it for implementing dropdowns. It needs an engaging selection mechanism.  

react-native-searchable-dropdown:  

  • It helps create searchable dropdown menus.  
  • It is useful for selecting options from a large dataset with search capabilities.  
  • It supports filtering options based on user input and displaying search results.  
  • We can use it for implementing dropdowns where searching within options is necessary.  

react-native-dropdown-autocomplete:  

  • It provides an autocomplete dropdown component for text input.  
  • It is useful for suggesting and autocompleting user input from a predefined list.  
  • It supports filtering options. It does so based on user input and customization of the suggestion list.  
  • We can use it for implementing dropdowns with search-as-you-type functionality.  

react-native-select-input-ios:  

  • It provides a dropdown component with a native iOS look and feels.  
  • It is useful for achieving a consistent user experience with iOS-style dropdowns.  
  • It supports features like header customization, search functionality, and callbacks.  
  • We can use it for implementing dropdowns in iOS-specific applications.  

react-native-dropdown-multiselect:  

  • It provides a dropdown component that allows many items selection.  
  • It is useful for selecting many options from a dropdown list.  
  • It supports customizable styles, item grouping, and selection callbacks.  
  • We can use it for implementing dropdowns with multi-select functionality.  

FAQ 

1. What is a Dropdown component, and how does it work? 

A Dropdown component is a user interface element. It provides a list of options that the user can select. It consists of a button or input field that, when clicked or activated. It displays a list of options in a dropdown menu. The component works by managing the state of its visibility and selected value. It also updates the selected value based on the user's choice. When the user interacts with the dropdown, it triggers events to open or close the dropdown menu. 

  

2. How do search boxes integrate with React Native's dropdown library? 

We can integrate the Search boxes with the dropdown library to enhance functionality. Users can search and filter options within the dropdown menu. We can do it by incorporating a search box within the dropdown component. The dropdown library can update the list of options displayed as the user types using the search box. They can do so based on the search query. It helps provide real-time filtering and an efficient way to navigate many options. 

  

3. Are any other React components compatible with the dropdown library? 

React Native's dropdown library can work with various other React components. For instance, we can combine a library for managing navigation between screens. By incorporating the dropdown component, users can navigate to different screens. They can do so while retaining the dropdown state and selected values. They can also create a smooth user experience. 

  

4. What libraries of components can I use to create a custom dropdown list in React Native? 

There are several component libraries available. We can use it to build a custom dropdown list in React Native. These libraries like react-native-dropdown-picker, react-native-modal-dropdown, and react-native-select-input-ios. It provides pre-built dropdown components with customizable styles, animations, and features. By utilizing these libraries, developers can save time and effort. They can do so by leveraging their existing dropdown functionality. It will do so while having the flexibility to customize the appearance and behavior. It helps suit their specific needs. 

  

5. How can I add a scroll indicator when scrolling through the items in my dropdown list? 

You can use a component to add a scroll indicator when scrolling through the items in a dropdown list. We can display a vertical scroll indicator by wrapping the dropdown items. We can also do so by enabling the scroll indicator prop. We can do so when the list exceeds the available space. This scroll indicator provides users with feedback on their position within the list. It makes guiding through a long list of options easier. 

  

6. What is a Functional Component, and how does it relate to the react native dropdown library? 

A Functional Component is a stateless component defined as a JavaScript function. It is an alternative to class components. It offers a simpler syntax and lifecycle management. We can use the React native dropdown library within Functional Components. It can do so by importing and utilizing the necessary functions and hooks. For example, the useState hook can manage the dropdown's state variables. It can do so while allowing developers to create reusable dropdown components. 

  

7. How do I construct a popup list using the React native dropdown library? 

To construct a list using this library, you can combine components and event handling. By using TouchableOpacity, you can create a popup effect when we activate the dropdown. The library triggers the events to open/close the popup list when the user interacts. It displays the available options. This approach provides an intuitive way to present the dropdown options to the user. 

  

8. What View style should I use to display my selected items from the dropdown list? 

To display the selected items from the dropdown list, you can use the View style in React Native. You can control their layout and appearance by applying styles to the View component. It wraps the selected items. You can use flexbox properties to arrange the selected items horizontally or vertically. Additionally, you can apply styling to the individual items. The individual items can be Text components. It helps differentiate them from the rest of the dropdown options. It provides visual cues to the user about their selection. 

Kivy is an open-source Python framework. It enables the development of multi-platform applications. It focuses on creating touch-based, graphical user interfaces (GUIs). It allows developers to build applications for desktop computers and other touch-based platforms.  

Key features of Kivy include:  

  • Cross-platform: Kivy applications can run on various platforms without significantly modifying the code.  
  • Natural user interfaces: Kivy is designed to support touch interfaces. It makes it suitable for building applications for smartphones, tablets, and other touch-enabled devices.  
  • Rich UI elements: It provides various customizable UI elements. It provides buttons, sliders, and more.  
  • Graphics and multimedia: Kivy supports multimedia elements like images, videos, and audio.  
  • Event-driven programming: Kivy follows an event-driven programming paradigm. It allows developers to respond to user interactions and events.  
  • Python-based: Kivy is written in Python. It makes it accessible to developers who are already familiar with the language.  
  • Open-source community: Kivy has an active and growing community of developers. It means many resources, documentation, and libraries are available to help newcomers.  

   

Kivy is a popular choice for creating mobile applications and games. Python developers like this framework because it works well on various platforms.  

   

In Kivy, a dropdown is a GUI widget that presents selectable options in a menu. It allows users to choose one option from a list of items by clicking or tapping the dropdown. Then choose the desired item from the list that appears. The Dropdown widget in Kivy is part of the Kivy.ix.dropdown module. It is often used to provide a more compact way of selecting options from a larger set of choices.  

   

Here is an example of how to create a dropdown in Kivy:  

Fig: Preview of the output that you will get on running this code from your IDE.

Code

In this solution, we are using Kivy and KivyMD Libraries.

Instructions

Follow the steps carefully to get the output quickly.

  1. Install PyCharm Community Edition on your computer.
  2. Open the terminal and install the required libraries with the following commands.
  3. Install Kivy - pip install kivy.
  4. Install KivyMD - pip install kivymd.
  5. Create a new Python file(eg: test.py).
  6. Copy the snippet using the 'copy' button and paste it into that file.
  7. Run the file using the run button.


I hope you found this helpful. I have added the link to dependent libraries, and version information in the following sections.


I found this code snippet by searching for 'how to make a dropdown list in kivy' in kandi. You can try any such use case!

Environment Tested

I tested this solution in the following versions. Be mindful of changes when working with other versions.

  1. The solution is created in PyCharm 2022.3.3.
  2. The solution is tested on Python 3.9.7.
  3. Kivy version 2.2.1.
  4. KivyMD version 1.1.1.


Using this solution, we are able to create a dropdown in kivy with simple steps. This process also facilities an easy way to use, hassle-free method to create a hands-on working version of code which would help us to create a dropdown in kivy.

Dependent Libraries

You can also search for any dependent libraries on kandi like 'Kivy' and 'KivyMD'.

FAQ:  

1. What is a dropdown menu in Kivy?  

A dropdown menu is a common way to show a list of options that expand when clicked. Users can then choose an option from the list.  

   

2. How do I import Kivy in my Python script?  

To use Kivy in your Python script, you have to import the Kivy module. You may also need to import other Kivy-related modules like Kivy.app, kivy.uix.dropdown).  

   

3. How do I create a basic dropdown menu in Kivy?  

To create a basic dropdown menu in Kivy, you can use the DropDown class and Button widgets.  

   

4. Can I customize the appearance of the dropdown menu?  

You can change how the dropdown menu looks by changing its properties. You can create your custom dropdown widget by subclassing DropDown and Button.  

   

5. Can I create a dropdown menu, like a BoxLayout, inside another widget?  

Yes, you can create a dropdown menu inside other widgets. For example, you can create a BoxLayout and add the main button, then add the dropdown as a child of the BoxLayout.  

Support

  1. For any support on kandi solution kits, please use the chat
  2. For further learning resources, visit the Open Weaver Community learning page.


This Java code using the Jsoup library helps to parse and process an XML hierarchy of categories and items by allowing you to extract specific information from the XML document. It enables you to select and extract only the category and item elements relevant to your task or analysis instead of manually parsing the entire document. 


The code can be used to simplify the parsing and processing of hierarchical data structures in XML documents. It demonstrates the use of two different techniques for selecting elements based on their attributes and structure. These techniques can also be applied to other XML documents, making the code a useful starting point for working with XML data in Java. 


The classes jsoup.Jsoup, jsoup.nodes.Document, jsoup.parser.Parser, and jsoup.select.Elements are part of the Jsoup library, a Java library for working with HTML and XML documents. 

  • jsoup - Jsoup class provides static methods for parsing HTML and XML documents. It takes the document's source as input, such as a URL or a string, and returns a jsoup.node. Document object that represents the parsed document.  
  • jsoup.nodes - Document class represents an in-memory representation of an HTML or XML document. It provides methods for querying and manipulating the document, such as selecting elements based on a tag name, attribute value or CSS selector. 
  • jsoup.parser - Parser class is an enumeration that provides different parsers that can be used to parse an HTML or XML document. The default parser is the HTML parser, but other parsers, such as the XML parser, can be specified for documents that require different parsing rules. 
  • jsoup.select - Elements class represents a collection of HTML or XML elements selected based on a CSS selector. It provides methods for iterating over the selected elements and performing operations on them, such as getting the text content, the attributes, or the HTML representation of the element. 


The Jsoup library to parse and process XML hierarchies of categories and items can be helpful in various applications that require processing XML data. 

Preview of the output that you will get on running this code.

Code

In this solution we have used JSOUP Library.

  1. copy the code using the "Copy" button above, and paste it in a your Java IDE.
  2. Add jsoup Library in your code.
  3. Run the file to get the Output


I hope you found this useful. I have added the link to dependent libraries, version information in the following sections.


I found this code snippet by searching for "How to parse xml tag with same tag Name" in kandi. You can try any such use case!

Environment Tested

I tested this solution in the following version. Be mindful of changes when working with other versions.


  1. The solution is created and executed in java java version "1.8.0_251"
  2. The solution is tested on Joup Library version "1.13.1"


In this solution we are going to parse Nested XML with same tag name using Jsoup in java with simple steps. This process also facilities an easy to use, hassle free method to create a hands-on working version of code which would help us parse Nested XML with same tag name using Jsoup.

Dependent Library

If you do not have Jsoup that is required to run this code , You can just install it by clicking on the above link and copying the pip install command from the Jsoup page in Kand. You can search for any dependent library on kandi like Jsoup.

Support

  1. For any support on kandi solution kits, please use the chat
  2. For further learning resources, visit the Open Weaver Community learning page.

JSoup is a Java library used to engage with real HTML. It gives a technique to govern and parse HTML texts. JSoup can clean HTML documents.


It can extract data from HTML and do other HTML-related tasks. Utilizing Jsoup, you may parse HTML or XML tags. It aids of using the usage of the pick-out feature of the Document class. Additionally, JSoup offers APIs for editing HTML documents and adding new elements. JSoup is a versatile tool that parses XML tags in Java and works with XML in Java. It can apply to many uses. They must process, change, or parse XML data.

Here are a few times while you may use it:

  • Web scraping: It is the use of JSoup. It lets you pull data from XML documents. You download them from the internet. These documents can be RSS feeds or API answers. 
  • Data mining: JSoup can extract statistics for evaluation from large XML collections.  
  • You can use JSoup to read and confirm the HTML produced by a web app for automated testing of web applications. 
  • A Java program can process XML documents. It can also change them using JSoup. 
  • You can use JSoup in a Java application to interpret XML documents from other systems.


Here is an example of how you can parse XML tags using JSoup in Java for your application: 

Fig 1: Preview of the code snippet which I copied from the kandi.

Fig 2: code snippet continuation.

Fig 3: Preview of the output that you will get on running this code from your IDE.

Code

Using jsoup your code will be looks like this:

Instructions

  1. Copy the code using the "Copy" button above, and paste it in a Java file in your IDE(IntelliJ Preferable).
  2. Add the required dependencies and import them in java file.
  3. Run the file to generate the output.


I hope you found this useful. I have added the link to dependent libraries, version information in the following sections.


I found this code snippet by searching for 'how to parse nested xml tag with same tag name' in kandi. You can try any such use case!

Environment Tested

I tested this solution in the following IDE and versions. Be mindful of changes when working with other versions.

  1. The solution is created in IntelliJ IDE and Java jdk-'11.0.17'.
  2. The solution is tested on jsoup version-'1.7.2'


Using this solution, we are able to parse xml tags using jsoup in Java with simple steps. This process also facilities an easy way to use, hassle-free method to create a hands-on working version of code which would help us to parse the xml tags using jsoup in Java.

Dependent Libraries

You can add the dependent library in your gradle or maven files. you can get the dependancy xml in above link

You can search for any dependent library on kandi like jsoup java.

FAQ

1. How to parse XML using Jsoup in Java?

To parse XML with Jsoup in Java, use the Jsoup.parse() method, providing the XML string as input.


2. Can Jsoup handle large XML files?

Jsoup is better for parsing HTML. For large XML files, use dedicated XML parsers like JAXB or SAX.


3. How to select XML elements with Jsoup selectors?

Use Jsoup selectors. They are like CSS selectors. They target and extract specific XML elements from the parsed document.


4. Is Jsoup suitable for parsing complex XML structures?

The creators of Jsoup designed it for HTML parsing. For complex XML structures, consider using specialized XML libraries like DOM or StAX.


5. How to extract data from XML attributes using Jsoup?

Use Jsoup's Element.attr() method to retrieve values from XML attributes.

Support

  1. For any support on kandi solution kits, please use the chat
  2. For further learning resources, visit the Open Weaver Community learning page.


Here are the best open-source iOS calendar libraries for your applications. You can use these software development tools to integrate calendar functionality into their iOS applications easily.

 

There are several popular iOS Calendar Libraries available. These libraries provide a set of pre-built features that can be used to create custom calendar views, manage events and schedules, and synchronize data with the built-in iOS calendar app. These libraries provide a set of pre-built features that can be used to create custom calendar views, manage events and schedules, and synchronize data with the built-in iOS calendar app. Also, certain customizable calendar libraries offer a range of features, including support for Gregorian and Lunar calendars, event management, and animated transitions. It also provides a range of UI customization options, including custom colors, fonts, and header styles. Besides, you can use the built-in iOS framework to access the device's calendar and reminders. They allow developers to create, read, update, and delete events and reminders and respond to calendar and reminder notifications.

 

Overall, iOS Calendar Libraries provide developers with an efficient and customizable way to add calendar functionality to their iOS applications. By choosing the right library and leveraging its features, developers can create sophisticated calendar views and management tools that enhance the user experience of their applications. We have handpicked the top and trending open-source iOS calendar libraries for your next application development project.

EventKit:

  • Used in Mobile, iOS applications, etc.
  • This built-in iOS framework provides access to the device's calendar and reminders.
  • Allows to create, read, update, and delete events and reminders.

HorizonCalendar:

  • Used in Mobile, iOS, React applications, etc.
  • Allows displaying a range of dates in a vertical scrolling or horizontal scrolling calendar component.
  • Provides various customization points with support for a wide range of designs and use cases.

CalendarView:

  • Used in User Interface, Calendar applications, etc.
  • Provides "just drag and drop it in your code" calendar functionality for iOS.
  • Supports both vertical and horizontal scrolling, along with native calendar events.

JTAppleCalendar:

  • Used in User Interface, Calendar, React Native applications, etc.
  • Provides various customization options and features.
  • Supports different calendar types, event management, and custom date cells.

CVCalendar:

  • Used in User Interface, Calendar applications, etc.
  • Features include different calendar types, event management, and animated transitions.
  • Supports iOS 8+ and Swift (>= 4.0).

Swift-Calendar:

  • Used in User Interface, Calendar, Xcode applications, etc.
  • Provides a customizable calendar view with a range of UI customization options.
  • Supports different calendar types, event management, etc.

JZCalendarWeekView:

  • Used in User Interface, iOS Calendar applications, etc.
  • Offers iOS Calendar Week/Day View in Swift.
  • Provides support for event management and UI customization options.

CalendarKit:

  • Used to create iOS Calendar App in Swift.
  • Supports different calendar types and event management, calendar views, and management tools.
  • It looks like the Apple Calendar app out-of-the-box, with various UI customization options.

Here are the best open-source iOS slider libraries for your applications. You can use these pre-built components for creating slider controls in their iOS apps to enhance the user experience of their applications.

 

A slider is a UI component that allows users to select a value by dragging a thumb along a track. This UI element is commonly used in many iOS apps, such as music players, photo editors, and fitness apps, to name a few. The iOS Slider Libraries provide developers with various customizable slider controls that they can easily integrate into their apps. These libraries typically come with features such as customizing the sliderā€™s appearance, setting the minimum and maximum values, defining the step interval, and enabling or disabling user interaction. These libraries offer developers a quick and efficient way to add slider controls to their apps without creating them from scratch. They are designed to be easy to use and highly customizable, allowing developers to tailor them to their app's needs.

 

Overall, the iOS Slider Libraries are a valuable resource for developers looking to enhance their app user experience by adding slider controls. With a wide range of options, developers can choose the library that best suits their app requirements and implement it in minutes. We have handpicked the top and trending open-source iOS slider libraries for your next application development project.

RangeSlider:

  • Used for creating range sliders in User Interface, Animation, iOS applications, etc.
  • Allows users to select a range of values between a minimum and maximum.
  • Offers customization options for changes to the slider's appearance and behavior.

CircularSlider:

  • Used in Mobile, iOS, Xcode applications, etc.
  • Provides a circular slider that can be used to create unique and engaging interfaces.
  • Also, it can be customized with colors, text, and icons.

Fluid Slider:

  • Used for creating fluid sliders with smooth thumb transitions between values as the user drags it.
  • Supports both horizontal and vertical sliders.
  • Allows for customization of the slider's appearance.

SwiftUI-sliders:

  • Used in User Interface, Frontend Framework, Xcode applications, etc.
  • Allows building highly customizable sliders and tracks.
  • Provides different sizes for lower and upper-range thumbs.

RangeSeekSlider:

  • Used in Mobile, iOS, Xcode, Uikit applications, etc.
  • Provides a range slider like TTRangeSlider.
  • Additional features include customizable labels and setting a pre-selected range.

AORangeSlider:

  • Used in User Interface, Animation, iOS applications, etc.
  • Provides two handlers to pick a minimum and a maximum range.
  • It also allows for customization of the label's appearance.

AIFlatSwitch:

  • Used in Mobile, iOS, Uikit applications, etc.
  • Adding multiple positions provides a switch control that can be used as a slider. 
  • Supports customization of the switch's appearance.

GradientSlider:

  • Used for creating sliders with color picker functionality in iOS applications.
  • Provides a slider with a gradient background.
  • Can be customized with different colors and gradients.

Here are the best open-source iOS menu libraries for your applications. You can use these collections of software tools to create dynamic, responsive, and custom menu interfaces for iOS applications.


iOS Menu Libraries allow developers to create menu interfaces that are not only functional but also aesthetically pleasing and intuitive. These libraries provide developers with pre-built components, animations, and templates to simplify the menu interface creation process. The libraries are designed to work seamlessly with iOS, so they integrate well with the operating system and other iOS components. They offer different menu styles, such as drop-down, slide-out, and pop-up menus. Also, developers can customize the menu's appearance, including colors, fonts, and icons, to match their app's design. One of the primary benefits of using iOS Menu Libraries is that they can help developers create visually appealing and user-friendly menus. Using pre-built components, developers can quickly prototype and refine menu designs based on user feedback. This allows developers to iterate quickly and deliver high-quality menu interfaces that meet the needs of their users. Another advantage of using iOS Menu Libraries is that developers can focus on customizing the menus to fit their app's unique needs. This can significantly reduce development time and free up resources for other tasks.


We have handpicked the top and trending open-source iOS menu libraries for your next application development project. IOS Menu Libraries allow developers to create custom menu interfaces that enhance their app's usability and user experience. With various features and styles available, developers can choose the library that best suits their app's requirements and implement it in minutes.

SideMenu:

  • Used to create a simple and versatile side menu control in Swift for iOS devices.
  • Itā€™s a popular open-source menu library that offers a customizable side menu interface.
  • Supports multiple menu items and provides various animation effects for menu transitions.

RadialMenu:

  • Used in Mobile, iOS applications, etc.
  • Allows developers to create circular menus.
  • Offers various customization options and supports both touch and swipe gestures.

EZSwipeController:

  • Used to create a swipeable tab interface for menus.
  • Supports horizontal and vertical swipe gestures.
  • Offers customization options for animation effects.

Dropdowns:

  • Used to build dropdown interface for menus in iOS.
  • Itā€™s a simple, lightweight menu library supporting single and multi-select dropdowns.
  • Offers customization options for dropdown appearance.

PageMenu:

  • Used for building a paging menu interface in Swift for iOS devices.
  • Allows developers to create multiple pages.
  • Supports customization options for page appearance and animation effects.

BubbleTransition:

  • Used to create a bubble-like interface for menu transitions.
  • Supports both zoom and fade effects.
  • Offers customization options for bubble size and color.

GuillotineMenu:

  • Used in User Interface, Animation, iOS applications, etc.
  • Provides a unique and customizable menu interface.
  • Offers a vertical slide-out menu with a guillotine-style animation effect.

YNDropDownMenu:

  • Used to create e customizable dropdown menu interface.
  • Supports both single and multi-select dropdowns.
  • Offers customization options for dropdown appearance and animation effects.

ENSwiftSideMenu:

  • Used in User Interface, Menu, Uikit, iOS applications, etc.
  • Offers a lightweight flyover side menu component for iOS.
  • Features include UIDynamic's bouncing animation, UIGestures, and UIBlurEffect.

Trending Discussions on Mobile

App using Realtime database not working in Romania ISPs blocked by Firebase

Android studio - Generate signed APKs broke

Horizontal listview not scrolling on web but scrolling on mobile

Flutter iOS Error Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130)

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent, On AlarmPingSender

Android Build Error: "lStar not found..."

How do I get mobile status for discord bot by directly modifying IDENTIFY packet?

Data path "" must NOT have additional properties(extractCss) in Angular 13 while upgrading project

Flutter Web: Cannot scroll with mouse down (drag) (Flutter 2.5+)

clarity.js by Microsoft slowing overall page loads

QUESTION

App using Realtime database not working in Romania ISPs blocked by Firebase

Asked 2022-Mar-29 at 13:21

I'm facing a critical issue right now in Romania. So for almost 24 hours my mobile app which is using Firebase Realtime Database can't be used on some ISPs (like Vodafone, DIGI or Telekom) if you are using mobile data (4G or 5G) the app is working fine, but on Wi-fi (on these ISPs the app is getting timeout). I talked like several hours on the phone with multiple ISPs and the Firebase support (right now the app is working using DIGI, but nobody knows why). The ISPs are saying that problem is not on their end and Firebase is saying that the problem is on the ISP side. Firebase support answer:

As this has been caused by network issues, rather than Google's infrastructure, we can't do much about it from our end. I would recommend that you contact the ISP provider directly as they will be able to check deeper on their side.

As far as we can see, the multiple providers are affected by that issue. Our engineering team is already aware of that and looking for solutions. Like I said before, there is nothing we could do with the providers, but our engineers would find any suitable workaround.

So my question is: what can I do? (I saw that Firebase realtime database deployed in europe-west works) but mine is already on united states.

Is there someone having troubles like me? I tested multiple apps which I know are using Firebase and they are having the same issues, the app being unreachable over this type of network.

Updates on the issue: enter image description here

So the problem is regarding Ukraine and Russia :(. Many apps using Firebase Realtime Database are not working right now.

Below I posted a fix for this and how I handled in order to make my app functional again

ANSWER

Answered 2022-Mar-29 at 13:21

So for someone who is in Europe and has the same issue like me, this is what i did.

I made a new instance of a realtime database on europe-west (because this one works on every ISP). I migrated my old database to the new one. I pushed for release a new iOS and Android build using the new database. I disabled my old instance in order to not have any syncing problems. I made all of this at night hours like 24:00.

I the morning all users would have the new update. If someone is not going to have the update until 10 AM I have set a push notification to announce this changes.

Source https://stackoverflow.com/questions/71444553

QUESTION

Android studio - Generate signed APKs broke

Asked 2022-Mar-15 at 13:50

I just updated my Android studio to the version 2021.1.1 Canary 12. After struggling to make it work, I had to also upgrade my Gradle and Gradle plugin to 7.0.2. Now I can compile my project and launch my app on my mobile, everything is working. But when I try to generate a Signed APK, I get a strange message after building telling me: APK(s) generated successfully for module 'android-mobile-app-XXXX.app' with 0 build variants:

enter image description here

Even though the build seem to be successful I cannot find the generated APK anywhere (and considering the time it takes to give me that error, I don't even think it is building anything). Now, I have been generating an APK every week for years now, so I know my way around the folders, the different build variant output folders etc... Nothing changed in my way of generating an APK. I do it via AS and follow the very standard procedure.

Can someone point to me what am I missing here? I assume there is a way to select a specific build variant when generating a signed APK, how does it works?

PS: Obviously, I am selecting my variant here during the process: enter image description here

PS2: I can generate a debug APK without any issue whatsoever.

ANSWER

Answered 2021-Oct-05 at 07:39

After a few days of struggle, I ended up switching to Bundle. It achieves the same purpose for me and it actually works so... That's my solution here.

Source https://stackoverflow.com/questions/69408222

QUESTION

Horizontal listview not scrolling on web but scrolling on mobile

Asked 2022-Mar-02 at 19:02

After flutter 2.5 update listview is scrolling only on mobile platforms. It doesn't scroll when I open it on the web. It was working fine in the previous version. I tried the scroll physics but it didn't work. what do you suggest i do? sorry for my bad english.

1
2          return SizedBox(
3            height: 400,
4            child: ListView.builder(
5                physics: ClampingScrollPhysics(),
6                scrollDirection: Axis.horizontal,
7                // ignore: unnecessary_null_comparison
8                itemCount: items == null ? 0 : items.length,
9                itemBuilder: (context, index) {
10                  return GestureDetector(
11                      onTap: () {
12                        LoginForm();
13                      },
14                      child: Container(
15                        margin:
16                            EdgeInsets.symmetric(horizontal: 20, vertical: 6),
17                        child: SizedBox(
18                          width: 400,
19                          height: 50,
20                          child: Stack(
21                            fit: StackFit.expand,
22                            children: <Widget>[
23                              Container(
24                                decoration: BoxDecoration(
25                                    borderRadius:
26                                        BorderRadius.all(Radius.circular(20.0)),
27                                    boxShadow: [
28                                      BoxShadow(
29                                          color: fromCssColor(
30                                              items[index].color.toString()),
31                                          // color: Colors.black38,
32                                          offset: Offset(2.0, 2.0),
33                                          blurRadius: 5.0,
34                                          spreadRadius: 1.0)
35                                    ]),
36                              ),
37                              ClipRRect(
38                                borderRadius:
39                                    BorderRadius.all(Radius.circular(20.0)),
40                                child: Image.asset(
41                                  items[index].image.toString(),
42                                  fit: BoxFit.cover,
43                                ),
44                              ),
45                              Container(
46                                decoration: BoxDecoration(
47                                    borderRadius:
48                                        BorderRadius.all(Radius.circular(20.0)),
49                                    gradient: LinearGradient(
50                                        begin: Alignment.topCenter,
51                                        end: Alignment.bottomCenter,
52                                        colors: [
53                                          Colors.transparent,
54                                          Colors.black45
55                                        ]))
56                                    ),
57                                  ],
58                                ),
59                              ),
60                              
61

ANSWER

Answered 2022-Mar-02 at 19:02
Flutter 2.5 Summary

ScrollBehaviors now allow or disallow drag scrolling from specified PointerDeviceKinds. ScrollBehavior.dragDevices, by default, allows scrolling widgets to be dragged by all PointerDeviceKinds except for PointerDeviceKind.mouse.

1
2          return SizedBox(
3            height: 400,
4            child: ListView.builder(
5                physics: ClampingScrollPhysics(),
6                scrollDirection: Axis.horizontal,
7                // ignore: unnecessary_null_comparison
8                itemCount: items == null ? 0 : items.length,
9                itemBuilder: (context, index) {
10                  return GestureDetector(
11                      onTap: () {
12                        LoginForm();
13                      },
14                      child: Container(
15                        margin:
16                            EdgeInsets.symmetric(horizontal: 20, vertical: 6),
17                        child: SizedBox(
18                          width: 400,
19                          height: 50,
20                          child: Stack(
21                            fit: StackFit.expand,
22                            children: <Widget>[
23                              Container(
24                                decoration: BoxDecoration(
25                                    borderRadius:
26                                        BorderRadius.all(Radius.circular(20.0)),
27                                    boxShadow: [
28                                      BoxShadow(
29                                          color: fromCssColor(
30                                              items[index].color.toString()),
31                                          // color: Colors.black38,
32                                          offset: Offset(2.0, 2.0),
33                                          blurRadius: 5.0,
34                                          spreadRadius: 1.0)
35                                    ]),
36                              ),
37                              ClipRRect(
38                                borderRadius:
39                                    BorderRadius.all(Radius.circular(20.0)),
40                                child: Image.asset(
41                                  items[index].image.toString(),
42                                  fit: BoxFit.cover,
43                                ),
44                              ),
45                              Container(
46                                decoration: BoxDecoration(
47                                    borderRadius:
48                                        BorderRadius.all(Radius.circular(20.0)),
49                                    gradient: LinearGradient(
50                                        begin: Alignment.topCenter,
51                                        end: Alignment.bottomCenter,
52                                        colors: [
53                                          Colors.transparent,
54                                          Colors.black45
55                                        ]))
56                                    ),
57                                  ],
58                                ),
59                              ),
60                              
61import 'package:flutter/material.dart';
62
63// Set ScrollBehavior for an entire application.
64MaterialApp(
65  scrollBehavior: MyCustomScrollBehavior(),
66  // ...
67);
68
1
2          return SizedBox(
3            height: 400,
4            child: ListView.builder(
5                physics: ClampingScrollPhysics(),
6                scrollDirection: Axis.horizontal,
7                // ignore: unnecessary_null_comparison
8                itemCount: items == null ? 0 : items.length,
9                itemBuilder: (context, index) {
10                  return GestureDetector(
11                      onTap: () {
12                        LoginForm();
13                      },
14                      child: Container(
15                        margin:
16                            EdgeInsets.symmetric(horizontal: 20, vertical: 6),
17                        child: SizedBox(
18                          width: 400,
19                          height: 50,
20                          child: Stack(
21                            fit: StackFit.expand,
22                            children: <Widget>[
23                              Container(
24                                decoration: BoxDecoration(
25                                    borderRadius:
26                                        BorderRadius.all(Radius.circular(20.0)),
27                                    boxShadow: [
28                                      BoxShadow(
29                                          color: fromCssColor(
30                                              items[index].color.toString()),
31                                          // color: Colors.black38,
32                                          offset: Offset(2.0, 2.0),
33                                          blurRadius: 5.0,
34                                          spreadRadius: 1.0)
35                                    ]),
36                              ),
37                              ClipRRect(
38                                borderRadius:
39                                    BorderRadius.all(Radius.circular(20.0)),
40                                child: Image.asset(
41                                  items[index].image.toString(),
42                                  fit: BoxFit.cover,
43                                ),
44                              ),
45                              Container(
46                                decoration: BoxDecoration(
47                                    borderRadius:
48                                        BorderRadius.all(Radius.circular(20.0)),
49                                    gradient: LinearGradient(
50                                        begin: Alignment.topCenter,
51                                        end: Alignment.bottomCenter,
52                                        colors: [
53                                          Colors.transparent,
54                                          Colors.black45
55                                        ]))
56                                    ),
57                                  ],
58                                ),
59                              ),
60                              
61import 'package:flutter/material.dart';
62
63// Set ScrollBehavior for an entire application.
64MaterialApp(
65  scrollBehavior: MyCustomScrollBehavior(),
66  // ...
67);
68import 'package:flutter/gestures.dart';
69import 'package:flutter/material.dart';
70
71class MyCustomScrollBehavior extends MaterialScrollBehavior {
72  // Override behavior methods and getters like dragDevices
73  @override
74  Set<PointerDeviceKind> get dragDevices => {
75        PointerDeviceKind.touch,
76        PointerDeviceKind.mouse,
77      };
78}
79

Source https://stackoverflow.com/questions/69154468

QUESTION

Flutter iOS Error Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130)

Asked 2022-Mar-01 at 05:29

Hi am facing an issue while running flutter project in MacBook Air M1 chip Lap. Tried all possibilities couldn't find where is the exact problem.

All basic solutions like flutter clean, flutter pub get, pod deintegrate & install, flutter build ios, flutter run but still same issue. only on iOS simulator not deploying.

Any solution for this. Thanks in advance.

Error

1Launching lib/main.dart on iPhone 13 in debug mode...
2Running pod install...                                              5.3s
3Running Xcode build...                                                  
4Xcode build done.                                           104.1s
5Failed to build iOS app
6Error output from Xcode build:
7ā†³
8    objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
9    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
10    objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
11    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
12    ** BUILD FAILED **
13

flutter doctor -v

1Launching lib/main.dart on iPhone 13 in debug mode...
2Running pod install...                                              5.3s
3Running Xcode build...                                                  
4Xcode build done.                                           104.1s
5Failed to build iOS app
6Error output from Xcode build:
7ā†³
8    objc[25282]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libamsupport.dylib (0x203913130) and
9    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc02c8). One of the two will be used. Which one is undefined.
10    objc[25282]: Class AMSupportURLSession is implemented in both /usr/lib/libamsupport.dylib (0x203913180) and
11    /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x103bc0318). One of the two will be used. Which one is undefined.
12    ** BUILD FAILED **
13[āœ“] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
14    en-IN)
15    ā€¢ Flutter version 2.8.1 at
16      /Users/macsystem/Documents/developer/flutter
17    ā€¢ Upstream repository https://github.com/flutter/flutter.git
18    ā€¢ Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
19    ā€¢ Engine revision 890a5fca2e
20    ā€¢ Dart version 2.15.1
21
22[āœ“] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
23    ā€¢ Android SDK at /Users/macsystem/Library/Android/sdk
24    ā€¢ Platform android-32, build-tools 32.0.0
25    ā€¢ Java binary at: /Applications/Android
26      Studio.app/Contents/jre/Contents/Home/bin/java
27    ā€¢ Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
28    ā€¢ All Android licenses accepted.
29
30[āœ“] Xcode - develop for iOS and macOS (Xcode 13.2.1)
31    ā€¢ Xcode at /Applications/Xcode.app/Contents/Developer
32    ā€¢ CocoaPods version 1.11.2
33
34[āœ“] Chrome - develop for the web
35    ā€¢ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
36
37[āœ“] Android Studio (version 2020.3)
38    ā€¢ Android Studio at /Applications/Android Studio.app/Contents
39    ā€¢ Flutter plugin can be installed from:
40      šŸ”Ø https://plugins.jetbrains.com/plugin/9212-flutter
41    ā€¢ Dart plugin can be installed from:
42      šŸ”Ø https://plugins.jetbrains.com/plugin/6351-dart
43    ā€¢ Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
44
45[āœ“] Connected device (2 available)
46    ā€¢ iPhone 13 (mobile) ā€¢ 05EC9698-3C26-44B9-8DB0-B53C7B6576F3 ā€¢ ios
47      ā€¢ com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
48    ā€¢ Chrome (web)       ā€¢ chrome                               ā€¢ web-javascript
49      ā€¢ Google Chrome 97.0.4692.99
50

ANSWER

Answered 2022-Feb-02 at 04:43

I have been facing this same issue for some time now. the same setup is working nicely in a mac with intel chip. But i have even done a resetup of my system, m1 mac still throws the same error.

Source https://stackoverflow.com/questions/70936334

QUESTION

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent, On AlarmPingSender

Asked 2022-Feb-20 at 16:06
Problem

Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. I got it after updating target SDK to 31. the error always come after AlarmPingSender. But i dont know any class that used AlarmPingSender.

1
22021-10-31 10:43:04.990 17031-17341/com.app.mobile D/AlarmPingSender: Register alarmreceiver to MqttServiceMqttService.pingSender.com.app.mobile-2e24ccbde048f2e91635651784
32021-10-31 10:43:04.993 17031-17341/com.app.mobile E/AndroidRuntime: FATAL EXCEPTION: MQTT Rec: com.app.mobile-2e24ccbde048f2e91635651784
4    Process: com.app.mobile, PID: 17031
5    java.lang.IllegalArgumentException: com.app.mobile: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
6    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
7        at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
8        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
9        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
10        at org.eclipse.paho.android.service.AlarmPingSender.start(AlarmPingSender.java:76)
11        at org.eclipse.paho.client.mqttv3.internal.ClientState.connected(ClientState.java:1150)
12        at org.eclipse.paho.client.mqttv3.internal.ClientState.notifyReceivedAck(ClientState.java:987)
13        at org.eclipse.paho.client.mqttv3.internal.CommsReceiver.run(CommsReceiver.java:118)
14        at java.lang.Thread.run(Thread.java:920)
15
16
What I Already done
  • Upgrade WorkManager to 2.7.0
  • set AllProject to force use WorkManager to 2.7.0
  • change all existing PendingIntent to use FLAG_IMMUTABLE
  • there's old code that still use gcm and disable it
  • Updating all Firebase package (some said its because of later version of analytics)
Library Used
  • OneSignal
  • Qiscus
  • Firebase
  • WorkManager

ANSWER

Answered 2021-Oct-31 at 07:02

Possible solution

Upgrade google analytics to firebase analaytics. Hope it'll solve your problems.Also upgrade all the library what're you using.

For me below solutions solve the problem.

Add PendingIntent.FLAG_IMMUTABLE to your pending intents.

Here is an example -

PendingIntent pendingIntent = PendingIntent.getActivity(this, alarmID, notificationIntent, PendingIntent.FLAG_IMMUTABLE);

For further information follow this link - https://developer.android.com/reference/android/app/PendingIntent#FLAG_IMMUTABLE

Source https://stackoverflow.com/questions/69783824

QUESTION

Android Build Error: "lStar not found..."

Asked 2022-Feb-18 at 06:59

I have error like this after trying to build my apps in Emulator

/Users/joel/.gradle/caches/transforms-3/06231cc1265260b25a06bafce7a4176f/transformed/core-1.7.0-alpha02/res/values/values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

I don't know what causes this error. After digging some answer which has similarly error (but in flutter) Problem. But still not solved my issue.

I have this dependency in my project

1buildscript {
2    repositories {
3        google()
4        maven { url 'https://plugins.gradle.org/m2/' }
5    }
6
7    dependencies {
8        classpath 'com.google.gms:google-services:4.3.3'
9        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
10    }
11}
12apply plugin: 'com.android.application'
13apply plugin: 'com.google.gms.google-services'
14apply plugin: 'kotlin-android'
15apply plugin: 'kotlin-android-extensions'
16apply plugin: 'kotlin-kapt'
17apply plugin: 'com.google.firebase.crashlytics'
18
19repositories {
20    maven { url 'https://maven.fabric.io/public' }
21    maven { url 'https://maven.google.com' }
22    maven { url  "https://teads.jfrog.io/artifactory/SDKAndroid-maven-prod"}
23    mavenCentral()
24
25}
26
27android {
28    compileSdkVersion 29
29    buildToolsVersion '28.0.3'
30    defaultConfig {
31        applicationId "mobile.apps.my"
32        minSdkVersion 17
33        targetSdkVersion 29
34        multiDexEnabled true
35        versionCode 152
36        versionName "8.1.7"
37        vectorDrawables.useSupportLibrary = true // This line hereP
38        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
39    }
40
41    compileOptions {
42        sourceCompatibility JavaVersion.VERSION_1_8
43        targetCompatibility JavaVersion.VERSION_1_8
44    }
45
46    dataBinding {
47        enabled = true
48    }
49
50    buildTypes {
51        debug {
52            firebaseCrashlytics {
53                mappingFileUploadEnabled false
54            }
55        }
56
57        release {
58            minifyEnabled true
59            shrinkResources true
60            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
61        }
62    }
63
64    lintOptions {
65        checkReleaseBuilds false
66        abortOnError false
67    }
68}
69
70dependencies {
71
72    implementation fileTree(include: ['*.jar'], dir: 'libs')
73    androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0-beta01', {
74        exclude group: 'com.android.support', module: 'support-annotations'
75    })
76    //noinspection GradleCompatible
77    implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
78    implementation "androidx.appcompat:appcompat-resources:1.4.0-alpha03"
79
80    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
81    implementation 'androidx.preference:preference:1.1.1'
82    implementation 'com.google.android.material:material:1.4.0'
83    implementation 'androidx.recyclerview:recyclerview:1.2.1'
84    implementation 'androidx.cardview:cardview:1.0.0'
85    implementation 'androidx.percentlayout:percentlayout:1.0.0'
86
87    implementation 'com.google.android.gms:play-services-analytics:17.0.0'
88    implementation 'it.sephiroth.android.library.imagezoom:imagezoom:2.3.0'
89    testImplementation 'org.json:json:20140107'
90    implementation 'com.comscore:android-analytics:6.1.0'
91    implementation 'com.android.support:customtabs:29.0.0'
92    implementation 'androidx.viewpager2:viewpager2:1.0.0'
93    implementation 'com.android.support:customtabs:29.0.0'
94
95    // Kodein Dependency Injection
96    implementation 'org.kodein.di:kodein-di-generic-jvm:6.2.1'
97    implementation 'org.kodein.di:kodein-di-framework-android-x:6.2.1'
98
99    // RETROFIT
100    implementation 'com.squareup.retrofit2:retrofit:2.6.0'
101    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
102    implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
103    implementation 'com.google.code.gson:gson:2.8.5'
104    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0' // for test String
105
106
107    // Room components
108    implementation "androidx.room:room-runtime:2.2.5"
109    kapt "androidx.room:room-compiler:2.2.5"
110    implementation "androidx.room:room-ktx:2.2.5"
111    androidTestImplementation "androidx.room:room-testing:2.2.5"
112
113    // Lifecycle components
114    implementation 'android.arch.lifecycle:extensions:1.1.1'
115    implementation 'androidx.paging:paging-runtime:2.1.2'
116
117    // UI
118    implementation 'com.squareup.picasso:picasso:2.71828'
119    implementation 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
120    implementation 'com.github.bluzwong:swipeback:0.2.0@aar'
121    implementation 'com.airbnb.android:lottie:3.6.0'
122
123    implementation 'com.veinhorn.scrollgalleryview:library:1.2.6'
124    implementation 'com.veinhorn.scrollgalleryview:picasso-loader:1.2.4'
125    implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.1'
126    implementation "com.andkulikov:transitionseverywhere:1.8.1"
127
128
129    // HTTP LOGGING
130    implementation 'com.jakewharton.timber:timber:4.7.1'
131    implementation 'org.jsoup:jsoup:1.13.1'
132    implementation 'androidx.multidex:multidex:2.0.1'
133
134
135    // ADS
136    implementation 'com.android.support:support-annotations:28.0.0'
137    // Required Dependency by Audience Network SDK
138    implementation 'com.google.android.gms:play-services-ads:19.7.0'
139    implementation 'com.google.android.gms:play-services-basement:17.6.0'
140    implementation("tv.teads.sdk.android:sdk:4.7.2@aar") {
141        transitive = true
142    }
143    implementation 'com.criteo.publisher:criteo-publisher-sdk:4.0.0'
144    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
145    implementation 'com.google.android.gms:play-services-base:17.6.0'
146
147    implementation ('com.facebook.android:audience-network-sdk:5.5.0'){
148        exclude group: 'com.google.android.gms'
149    }
150
151    implementation 'com.google.firebase:firebase-crashlytics:17.4.0'
152
153    implementation "androidx.core:core-ktx:1.6.0"  // I have update this based on other solution
154    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
155    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
156
157    // COROUTINES
158    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
159    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
160    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
161
162    // Kotlin + coroutines
163    implementation "androidx.work:work-runtime-ktx:2.5.0"
164
165    implementation 'com.github.mumayank:AirLocation:1.3.1'
166    androidTestImplementation 'androidx.test:rules:1.3.0-beta01'
167
168    implementation 'com.android.installreferrer:installreferrer:2.2'
169
170    //ANIMATION
171    implementation 'com.daimajia.androidanimations:library:2.4@aar'
172    implementation 'com.infideap.drawerbehavior:drawer-behavior:1.0.4'
173    implementation 'com.romandanylyk:pageindicatorview:1.0.3'
174
175    implementation 'org.ocpsoft.prettytime:prettytime:5.0.0.Final'
176
177    //SOCIAL
178    implementation 'com.google.android.gms:play-services-auth:19.0.0'
179
180}
181

I have tried to upgrade version of androidx.core:core-ktx:1.6.0 then sync or invalidate cache/restart. But none of them give me good result. I am sure yesterday my project was alright with same dependency. Someone please help me, if this question unclear let me add more information. Thanks

ANSWER

Answered 2021-Sep-28 at 17:18

I managed to fix this by upgrading compileSdk to 31 and kotlin gradle plugin to 1.5.10

1buildscript {
2    repositories {
3        google()
4        maven { url 'https://plugins.gradle.org/m2/' }
5    }
6
7    dependencies {
8        classpath 'com.google.gms:google-services:4.3.3'
9        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
10    }
11}
12apply plugin: 'com.android.application'
13apply plugin: 'com.google.gms.google-services'
14apply plugin: 'kotlin-android'
15apply plugin: 'kotlin-android-extensions'
16apply plugin: 'kotlin-kapt'
17apply plugin: 'com.google.firebase.crashlytics'
18
19repositories {
20    maven { url 'https://maven.fabric.io/public' }
21    maven { url 'https://maven.google.com' }
22    maven { url  "https://teads.jfrog.io/artifactory/SDKAndroid-maven-prod"}
23    mavenCentral()
24
25}
26
27android {
28    compileSdkVersion 29
29    buildToolsVersion '28.0.3'
30    defaultConfig {
31        applicationId "mobile.apps.my"
32        minSdkVersion 17
33        targetSdkVersion 29
34        multiDexEnabled true
35        versionCode 152
36        versionName "8.1.7"
37        vectorDrawables.useSupportLibrary = true // This line hereP
38        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
39    }
40
41    compileOptions {
42        sourceCompatibility JavaVersion.VERSION_1_8
43        targetCompatibility JavaVersion.VERSION_1_8
44    }
45
46    dataBinding {
47        enabled = true
48    }
49
50    buildTypes {
51        debug {
52            firebaseCrashlytics {
53                mappingFileUploadEnabled false
54            }
55        }
56
57        release {
58            minifyEnabled true
59            shrinkResources true
60            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
61        }
62    }
63
64    lintOptions {
65        checkReleaseBuilds false
66        abortOnError false
67    }
68}
69
70dependencies {
71
72    implementation fileTree(include: ['*.jar'], dir: 'libs')
73    androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0-beta01', {
74        exclude group: 'com.android.support', module: 'support-annotations'
75    })
76    //noinspection GradleCompatible
77    implementation 'androidx.appcompat:appcompat:1.4.0-alpha03'
78    implementation "androidx.appcompat:appcompat-resources:1.4.0-alpha03"
79
80    implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
81    implementation 'androidx.preference:preference:1.1.1'
82    implementation 'com.google.android.material:material:1.4.0'
83    implementation 'androidx.recyclerview:recyclerview:1.2.1'
84    implementation 'androidx.cardview:cardview:1.0.0'
85    implementation 'androidx.percentlayout:percentlayout:1.0.0'
86
87    implementation 'com.google.android.gms:play-services-analytics:17.0.0'
88    implementation 'it.sephiroth.android.library.imagezoom:imagezoom:2.3.0'
89    testImplementation 'org.json:json:20140107'
90    implementation 'com.comscore:android-analytics:6.1.0'
91    implementation 'com.android.support:customtabs:29.0.0'
92    implementation 'androidx.viewpager2:viewpager2:1.0.0'
93    implementation 'com.android.support:customtabs:29.0.0'
94
95    // Kodein Dependency Injection
96    implementation 'org.kodein.di:kodein-di-generic-jvm:6.2.1'
97    implementation 'org.kodein.di:kodein-di-framework-android-x:6.2.1'
98
99    // RETROFIT
100    implementation 'com.squareup.retrofit2:retrofit:2.6.0'
101    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
102    implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
103    implementation 'com.google.code.gson:gson:2.8.5'
104    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0' // for test String
105
106
107    // Room components
108    implementation "androidx.room:room-runtime:2.2.5"
109    kapt "androidx.room:room-compiler:2.2.5"
110    implementation "androidx.room:room-ktx:2.2.5"
111    androidTestImplementation "androidx.room:room-testing:2.2.5"
112
113    // Lifecycle components
114    implementation 'android.arch.lifecycle:extensions:1.1.1'
115    implementation 'androidx.paging:paging-runtime:2.1.2'
116
117    // UI
118    implementation 'com.squareup.picasso:picasso:2.71828'
119    implementation 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
120    implementation 'com.github.bluzwong:swipeback:0.2.0@aar'
121    implementation 'com.airbnb.android:lottie:3.6.0'
122
123    implementation 'com.veinhorn.scrollgalleryview:library:1.2.6'
124    implementation 'com.veinhorn.scrollgalleryview:picasso-loader:1.2.4'
125    implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.1'
126    implementation "com.andkulikov:transitionseverywhere:1.8.1"
127
128
129    // HTTP LOGGING
130    implementation 'com.jakewharton.timber:timber:4.7.1'
131    implementation 'org.jsoup:jsoup:1.13.1'
132    implementation 'androidx.multidex:multidex:2.0.1'
133
134
135    // ADS
136    implementation 'com.android.support:support-annotations:28.0.0'
137    // Required Dependency by Audience Network SDK
138    implementation 'com.google.android.gms:play-services-ads:19.7.0'
139    implementation 'com.google.android.gms:play-services-basement:17.6.0'
140    implementation("tv.teads.sdk.android:sdk:4.7.2@aar") {
141        transitive = true
142    }
143    implementation 'com.criteo.publisher:criteo-publisher-sdk:4.0.0'
144    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
145    implementation 'com.google.android.gms:play-services-base:17.6.0'
146
147    implementation ('com.facebook.android:audience-network-sdk:5.5.0'){
148        exclude group: 'com.google.android.gms'
149    }
150
151    implementation 'com.google.firebase:firebase-crashlytics:17.4.0'
152
153    implementation "androidx.core:core-ktx:1.6.0"  // I have update this based on other solution
154    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
155    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
156
157    // COROUTINES
158    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1'
159    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
160    implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
161
162    // Kotlin + coroutines
163    implementation "androidx.work:work-runtime-ktx:2.5.0"
164
165    implementation 'com.github.mumayank:AirLocation:1.3.1'
166    androidTestImplementation 'androidx.test:rules:1.3.0-beta01'
167
168    implementation 'com.android.installreferrer:installreferrer:2.2'
169
170    //ANIMATION
171    implementation 'com.daimajia.androidanimations:library:2.4@aar'
172    implementation 'com.infideap.drawerbehavior:drawer-behavior:1.0.4'
173    implementation 'com.romandanylyk:pageindicatorview:1.0.3'
174
175    implementation 'org.ocpsoft.prettytime:prettytime:5.0.0.Final'
176
177    //SOCIAL
178    implementation 'com.google.android.gms:play-services-auth:19.0.0'
179
180}
181compileSdk = 31
182
183classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10'
184

Source https://stackoverflow.com/questions/69041630

QUESTION

How do I get mobile status for discord bot by directly modifying IDENTIFY packet?

Asked 2022-Feb-09 at 15:05

Apparently, discord bots can have mobile status as opposed to the desktop (online) status that one gets by default.

bot having mobile status

After a bit of digging I found out that such a status is achieved by modifying the IDENTIFY packet in discord.gateway.DiscordWebSocket.identify modifying the value of $browser to Discord Android or Discord iOS should theoretically get us the mobile status.

After modifying code snippets I found online which does this, I end up with this :

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32

Now all there is left to do is overwrite the discord.gateway.DiscordWebSocket.identify during runtime in the main file, something like this :

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32import discord
33import os
34from discord.ext import commands
35import mobile_status
36
37discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
38bot = commands.Bot(command_prefix="?")
39
40@bot.event
41async def on_ready():
42    print(f"Sucessfully logged in as {bot.user}")
43
44bot.run(os.getenv("DISCORD_TOKEN"))
45

And we do get the mobile status successfully
successful mobile status for bot

But here's the problem, I wanted to directly modify the file (which held the function) rather than monkey-patching it during runtime. So I cloned the dpy lib locally and edited the file on my machine, it ended up looking like this :

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32import discord
33import os
34from discord.ext import commands
35import mobile_status
36
37discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
38bot = commands.Bot(command_prefix="?")
39
40@bot.event
41async def on_ready():
42    print(f"Sucessfully logged in as {bot.user}")
43
44bot.run(os.getenv("DISCORD_TOKEN"))
45    async def identify(self):
46        """Sends the IDENTIFY packet."""
47        payload = {
48            'op': self.IDENTIFY,
49            'd': {
50                'token': self.token,
51                'properties': {
52                    '$os': sys.platform,
53                    '$browser': 'Discord Android',
54                    '$device': 'Discord Android',
55                    '$referrer': '',
56                    '$referring_domain': ''
57                },
58                'compress': True,
59                'large_threshold': 250,
60                'v': 3
61            }
62        }
63     # ...
64

(edited both $browser and $device to Discord Android just to be safe)

But this does not work and just gives me the regular desktop online icon.
So the next thing I did is to inspect the identify function after it has been monkey-patched, so I could just look at the source code and see what went wrong earlier, but due to hard luck I got this error :

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32import discord
33import os
34from discord.ext import commands
35import mobile_status
36
37discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
38bot = commands.Bot(command_prefix="?")
39
40@bot.event
41async def on_ready():
42    print(f"Sucessfully logged in as {bot.user}")
43
44bot.run(os.getenv("DISCORD_TOKEN"))
45    async def identify(self):
46        """Sends the IDENTIFY packet."""
47        payload = {
48            'op': self.IDENTIFY,
49            'd': {
50                'token': self.token,
51                'properties': {
52                    '$os': sys.platform,
53                    '$browser': 'Discord Android',
54                    '$device': 'Discord Android',
55                    '$referrer': '',
56                    '$referring_domain': ''
57                },
58                'compress': True,
59                'large_threshold': 250,
60                'v': 3
61            }
62        }
63     # ...
64Traceback (most recent call last):
65  File "c:\Users\Achxy\Desktop\fresh\file.py", line 8, in <module>
66    print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
67  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1024, in getsource
68    lines, lnum = getsourcelines(object)
69  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1006, in getsourcelines
70    lines, lnum = findsource(object)
71  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 835, in findsource
72    raise OSError('could not get source code')
73OSError: could not get source code
74

Code :

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32import discord
33import os
34from discord.ext import commands
35import mobile_status
36
37discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
38bot = commands.Bot(command_prefix="?")
39
40@bot.event
41async def on_ready():
42    print(f"Sucessfully logged in as {bot.user}")
43
44bot.run(os.getenv("DISCORD_TOKEN"))
45    async def identify(self):
46        """Sends the IDENTIFY packet."""
47        payload = {
48            'op': self.IDENTIFY,
49            'd': {
50                'token': self.token,
51                'properties': {
52                    '$os': sys.platform,
53                    '$browser': 'Discord Android',
54                    '$device': 'Discord Android',
55                    '$referrer': '',
56                    '$referring_domain': ''
57                },
58                'compress': True,
59                'large_threshold': 250,
60                'v': 3
61            }
62        }
63     # ...
64Traceback (most recent call last):
65  File "c:\Users\Achxy\Desktop\fresh\file.py", line 8, in <module>
66    print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
67  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1024, in getsource
68    lines, lnum = getsourcelines(object)
69  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1006, in getsourcelines
70    lines, lnum = findsource(object)
71  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 835, in findsource
72    raise OSError('could not get source code')
73OSError: could not get source code
74import discord
75import os
76from discord.ext import commands
77import mobile_status
78import inspect
79
80discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
81print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
82bot = commands.Bot(command_prefix="?")
83
84@bot.event
85async def on_ready():
86    print(f"Sucessfully logged in as {bot.user}")
87
88bot.run(os.getenv("DISCORD_TOKEN"))
89

Since this same behavior was exhibited for every patched function (aforementioned one and the loc["identify"]) I could no longer use inspect.getsource(...) and then relied upon dis.dis which lead to much more disappointing results

The disassembled data looks exactly identical to the monkey-patched working version, so the directly modified version simply does not work despite function content being the exact same. (In regards to disassembled data)

Notes: Doing Discord iOS directly does not work either, changing the $device to some other value but keeping $browser does not work, I have tried all combinations, none of them work.

TL;DR: How to get mobile status for discord bot without monkey-patching it during runtime?

ANSWER

Answered 2022-Feb-07 at 23:03

The following works by subclassing the relevant class, and duplicating code with the relevant changes. We also have to subclass the Client class, to overwrite the place where the gateway/websocket class is used. This results in a lot of duplicated code, however it does work, and requires neither dirty monkey-patching nor editing the library source code.

However, it does come with many of the same problems as editing the library source code - mainly that as the library is updated, this code will become out of date (if you're using the archived and obsolete version of the library, you have bigger problems instead).

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32import discord
33import os
34from discord.ext import commands
35import mobile_status
36
37discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
38bot = commands.Bot(command_prefix="?")
39
40@bot.event
41async def on_ready():
42    print(f"Sucessfully logged in as {bot.user}")
43
44bot.run(os.getenv("DISCORD_TOKEN"))
45    async def identify(self):
46        """Sends the IDENTIFY packet."""
47        payload = {
48            'op': self.IDENTIFY,
49            'd': {
50                'token': self.token,
51                'properties': {
52                    '$os': sys.platform,
53                    '$browser': 'Discord Android',
54                    '$device': 'Discord Android',
55                    '$referrer': '',
56                    '$referring_domain': ''
57                },
58                'compress': True,
59                'large_threshold': 250,
60                'v': 3
61            }
62        }
63     # ...
64Traceback (most recent call last):
65  File "c:\Users\Achxy\Desktop\fresh\file.py", line 8, in <module>
66    print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
67  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1024, in getsource
68    lines, lnum = getsourcelines(object)
69  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1006, in getsourcelines
70    lines, lnum = findsource(object)
71  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 835, in findsource
72    raise OSError('could not get source code')
73OSError: could not get source code
74import discord
75import os
76from discord.ext import commands
77import mobile_status
78import inspect
79
80discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
81print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
82bot = commands.Bot(command_prefix="?")
83
84@bot.event
85async def on_ready():
86    print(f"Sucessfully logged in as {bot.user}")
87
88bot.run(os.getenv("DISCORD_TOKEN"))
89import asyncio
90import sys
91
92import aiohttp
93
94import discord
95from discord.gateway import DiscordWebSocket, _log
96from discord.ext.commands import Bot
97
98
99class MyGateway(DiscordWebSocket):
100
101    async def identify(self):
102        payload = {
103            'op': self.IDENTIFY,
104            'd': {
105                'token': self.token,
106                'properties': {
107                    '$os': sys.platform,
108                    '$browser': 'Discord Android',
109                    '$device': 'Discord Android',
110                    '$referrer': '',
111                    '$referring_domain': ''
112                },
113                'compress': True,
114                'large_threshold': 250,
115                'v': 3
116            }
117        }
118
119        if self.shard_id is not None and self.shard_count is not None:
120            payload['d']['shard'] = [self.shard_id, self.shard_count]
121
122        state = self._connection
123        if state._activity is not None or state._status is not None:
124            payload['d']['presence'] = {
125                'status': state._status,
126                'game': state._activity,
127                'since': 0,
128                'afk': False
129            }
130
131        if state._intents is not None:
132            payload['d']['intents'] = state._intents.value
133
134        await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
135        await self.send_as_json(payload)
136        _log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
137
138
139class MyBot(Bot):
140
141    async def connect(self, *, reconnect: bool = True) -> None:
142        """|coro|
143
144        Creates a websocket connection and lets the websocket listen
145        to messages from Discord. This is a loop that runs the entire
146        event system and miscellaneous aspects of the library. Control
147        is not resumed until the WebSocket connection is terminated.
148
149        Parameters
150        -----------
151        reconnect: :class:`bool`
152            If we should attempt reconnecting, either due to internet
153            failure or a specific failure on Discord's part. Certain
154            disconnects that lead to bad state will not be handled (such as
155            invalid sharding payloads or bad tokens).
156
157        Raises
158        -------
159        :exc:`.GatewayNotFound`
160            If the gateway to connect to Discord is not found. Usually if this
161            is thrown then there is a Discord API outage.
162        :exc:`.ConnectionClosed`
163            The websocket connection has been terminated.
164        """
165
166        backoff = discord.client.ExponentialBackoff()
167        ws_params = {
168            'initial': True,
169            'shard_id': self.shard_id,
170        }
171        while not self.is_closed():
172            try:
173                coro = MyGateway.from_client(self, **ws_params)
174                self.ws = await asyncio.wait_for(coro, timeout=60.0)
175                ws_params['initial'] = False
176                while True:
177                    await self.ws.poll_event()
178            except discord.client.ReconnectWebSocket as e:
179                _log.info('Got a request to %s the websocket.', e.op)
180                self.dispatch('disconnect')
181                ws_params.update(sequence=self.ws.sequence, resume=e.resume, session=self.ws.session_id)
182                continue
183            except (OSError,
184                    discord.HTTPException,
185                    discord.GatewayNotFound,
186                    discord.ConnectionClosed,
187                    aiohttp.ClientError,
188                    asyncio.TimeoutError) as exc:
189
190                self.dispatch('disconnect')
191                if not reconnect:
192                    await self.close()
193                    if isinstance(exc, discord.ConnectionClosed) and exc.code == 1000:
194                        # clean close, don't re-raise this
195                        return
196                    raise
197
198                if self.is_closed():
199                    return
200
201                # If we get connection reset by peer then try to RESUME
202                if isinstance(exc, OSError) and exc.errno in (54, 10054):
203                    ws_params.update(sequence=self.ws.sequence, initial=False, resume=True, session=self.ws.session_id)
204                    continue
205
206                # We should only get this when an unhandled close code happens,
207                # such as a clean disconnect (1000) or a bad state (bad token, no sharding, etc)
208                # sometimes, discord sends us 1000 for unknown reasons so we should reconnect
209                # regardless and rely on is_closed instead
210                if isinstance(exc, discord.ConnectionClosed):
211                    if exc.code == 4014:
212                        raise discord.PrivilegedIntentsRequired(exc.shard_id) from None
213                    if exc.code != 1000:
214                        await self.close()
215                        raise
216
217                retry = backoff.delay()
218                _log.exception("Attempting a reconnect in %.2fs", retry)
219                await asyncio.sleep(retry)
220                # Always try to RESUME the connection
221                # If the connection is not RESUME-able then the gateway will invalidate the session.
222                # This is apparently what the official Discord client does.
223                ws_params.update(sequence=self.ws.sequence, resume=True, session=self.ws.session_id)
224
225
226bot = MyBot(command_prefix="?")
227
228
229@bot.event
230async def on_ready():
231    print(f"Sucessfully logged in as {bot.user}")
232
233bot.run("YOUR_BOT_TOKEN")
234

Personally, I think that the following approach, which does include some runtime monkey-patching (but no AST manipulation) is cleaner for this purpose:

1def get_mobile():
2    """
3    The Gateway's IDENTIFY packet contains a properties field, containing $os, $browser and $device fields.
4    Discord uses that information to know when your phone client and only your phone client has connected to Discord,
5    from there they send the extended presence object.
6    The exact field that is checked is the $browser field. If it's set to Discord Android on desktop,
7    the mobile indicator is is triggered by the desktop client. If it's set to Discord Client on mobile,
8    the mobile indicator is not triggered by the mobile client.
9    The specific values for the $os, $browser, and $device fields are can change from time to time.
10    """
11    import ast
12    import inspect
13    import re
14    import discord
15
16    def source(o):
17        s = inspect.getsource(o).split("\n")
18        indent = len(s[0]) - len(s[0].lstrip())
19
20        return "\n".join(i[indent:] for i in s)
21
22    source_ = source(discord.gateway.DiscordWebSocket.identify)
23    patched = re.sub(
24        r'([\'"]\$browser[\'"]:\s?[\'"]).+([\'"])',
25        r"\1Discord Android\2",
26        source_,
27    )
28
29    loc = {}
30    exec(compile(ast.parse(patched), "<string>", "exec"), discord.gateway.__dict__, loc)
31    return loc["identify"]
32import discord
33import os
34from discord.ext import commands
35import mobile_status
36
37discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
38bot = commands.Bot(command_prefix="?")
39
40@bot.event
41async def on_ready():
42    print(f"Sucessfully logged in as {bot.user}")
43
44bot.run(os.getenv("DISCORD_TOKEN"))
45    async def identify(self):
46        """Sends the IDENTIFY packet."""
47        payload = {
48            'op': self.IDENTIFY,
49            'd': {
50                'token': self.token,
51                'properties': {
52                    '$os': sys.platform,
53                    '$browser': 'Discord Android',
54                    '$device': 'Discord Android',
55                    '$referrer': '',
56                    '$referring_domain': ''
57                },
58                'compress': True,
59                'large_threshold': 250,
60                'v': 3
61            }
62        }
63     # ...
64Traceback (most recent call last):
65  File "c:\Users\Achxy\Desktop\fresh\file.py", line 8, in <module>
66    print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
67  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1024, in getsource
68    lines, lnum = getsourcelines(object)
69  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 1006, in getsourcelines
70    lines, lnum = findsource(object)
71  File "C:\Users\Achxy\AppData\Local\Programs\Python\Python39\lib\inspect.py", line 835, in findsource
72    raise OSError('could not get source code')
73OSError: could not get source code
74import discord
75import os
76from discord.ext import commands
77import mobile_status
78import inspect
79
80discord.gateway.DiscordWebSocket.identify = mobile_status.get_mobile()
81print(inspect.getsource(discord.gateway.DiscordWebSocket.identify))
82bot = commands.Bot(command_prefix="?")
83
84@bot.event
85async def on_ready():
86    print(f"Sucessfully logged in as {bot.user}")
87
88bot.run(os.getenv("DISCORD_TOKEN"))
89import asyncio
90import sys
91
92import aiohttp
93
94import discord
95from discord.gateway import DiscordWebSocket, _log
96from discord.ext.commands import Bot
97
98
99class MyGateway(DiscordWebSocket):
100
101    async def identify(self):
102        payload = {
103            'op': self.IDENTIFY,
104            'd': {
105                'token': self.token,
106                'properties': {
107                    '$os': sys.platform,
108                    '$browser': 'Discord Android',
109                    '$device': 'Discord Android',
110                    '$referrer': '',
111                    '$referring_domain': ''
112                },
113                'compress': True,
114                'large_threshold': 250,
115                'v': 3
116            }
117        }
118
119        if self.shard_id is not None and self.shard_count is not None:
120            payload['d']['shard'] = [self.shard_id, self.shard_count]
121
122        state = self._connection
123        if state._activity is not None or state._status is not None:
124            payload['d']['presence'] = {
125                'status': state._status,
126                'game': state._activity,
127                'since': 0,
128                'afk': False
129            }
130
131        if state._intents is not None:
132            payload['d']['intents'] = state._intents.value
133
134        await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
135        await self.send_as_json(payload)
136        _log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
137
138
139class MyBot(Bot):
140
141    async def connect(self, *, reconnect: bool = True) -> None:
142        """|coro|
143
144        Creates a websocket connection and lets the websocket listen
145        to messages from Discord. This is a loop that runs the entire
146        event system and miscellaneous aspects of the library. Control
147        is not resumed until the WebSocket connection is terminated.
148
149        Parameters
150        -----------
151        reconnect: :class:`bool`
152            If we should attempt reconnecting, either due to internet
153            failure or a specific failure on Discord's part. Certain
154            disconnects that lead to bad state will not be handled (such as
155            invalid sharding payloads or bad tokens).
156
157        Raises
158        -------
159        :exc:`.GatewayNotFound`
160            If the gateway to connect to Discord is not found. Usually if this
161            is thrown then there is a Discord API outage.
162        :exc:`.ConnectionClosed`
163            The websocket connection has been terminated.
164        """
165
166        backoff = discord.client.ExponentialBackoff()
167        ws_params = {
168            'initial': True,
169            'shard_id': self.shard_id,
170        }
171        while not self.is_closed():
172            try:
173                coro = MyGateway.from_client(self, **ws_params)
174                self.ws = await asyncio.wait_for(coro, timeout=60.0)
175                ws_params['initial'] = False
176                while True:
177                    await self.ws.poll_event()
178            except discord.client.ReconnectWebSocket as e:
179                _log.info('Got a request to %s the websocket.', e.op)
180                self.dispatch('disconnect')
181                ws_params.update(sequence=self.ws.sequence, resume=e.resume, session=self.ws.session_id)
182                continue
183            except (OSError,
184                    discord.HTTPException,
185                    discord.GatewayNotFound,
186                    discord.ConnectionClosed,
187                    aiohttp.ClientError,
188                    asyncio.TimeoutError) as exc:
189
190                self.dispatch('disconnect')
191                if not reconnect:
192                    await self.close()
193                    if isinstance(exc, discord.ConnectionClosed) and exc.code == 1000:
194                        # clean close, don't re-raise this
195                        return
196                    raise
197
198                if self.is_closed():
199                    return
200
201                # If we get connection reset by peer then try to RESUME
202                if isinstance(exc, OSError) and exc.errno in (54, 10054):
203                    ws_params.update(sequence=self.ws.sequence, initial=False, resume=True, session=self.ws.session_id)
204                    continue
205
206                # We should only get this when an unhandled close code happens,
207                # such as a clean disconnect (1000) or a bad state (bad token, no sharding, etc)
208                # sometimes, discord sends us 1000 for unknown reasons so we should reconnect
209                # regardless and rely on is_closed instead
210                if isinstance(exc, discord.ConnectionClosed):
211                    if exc.code == 4014:
212                        raise discord.PrivilegedIntentsRequired(exc.shard_id) from None
213                    if exc.code != 1000:
214                        await self.close()
215                        raise
216
217                retry = backoff.delay()
218                _log.exception("Attempting a reconnect in %.2fs", retry)
219                await asyncio.sleep(retry)
220                # Always try to RESUME the connection
221                # If the connection is not RESUME-able then the gateway will invalidate the session.
222                # This is apparently what the official Discord client does.
223                ws_params.update(sequence=self.ws.sequence, resume=True, session=self.ws.session_id)
224
225
226bot = MyBot(command_prefix="?")
227
228
229@bot.event
230async def on_ready():
231    print(f"Sucessfully logged in as {bot.user}")
232
233bot.run("YOUR_BOT_TOKEN")
234import sys
235from discord.gateway import DiscordWebSocket, _log
236from discord.ext.commands import Bot
237
238
239async def identify(self):
240    payload = {
241        'op': self.IDENTIFY,
242        'd': {
243            'token': self.token,
244            'properties': {
245                '$os': sys.platform,
246                '$browser': 'Discord Android',
247                '$device': 'Discord Android',
248                '$referrer': '',
249                '$referring_domain': ''
250            },
251            'compress': True,
252            'large_threshold': 250,
253            'v': 3
254        }
255    }
256
257    if self.shard_id is not None and self.shard_count is not None:
258        payload['d']['shard'] = [self.shard_id, self.shard_count]
259
260    state = self._connection
261    if state._activity is not None or state._status is not None:
262        payload['d']['presence'] = {
263            'status': state._status,
264            'game': state._activity,
265            'since': 0,
266            'afk': False
267        }
268
269    if state._intents is not None:
270        payload['d']['intents'] = state._intents.value
271
272    await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
273    await self.send_as_json(payload)
274    _log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
275
276
277DiscordWebSocket.identify = identify
278bot = Bot(command_prefix="?")
279
280
281@bot.event
282async def on_ready():
283    print(f"Sucessfully logged in as {bot.user}")
284
285bot.run("YOUR_DISCORD_TOKEN")
286

As to why editing the library source code did not work for you, I can only assume that you have edited the wrong copy of the file, as people have commented.

Source https://stackoverflow.com/questions/70903401

QUESTION

Data path "" must NOT have additional properties(extractCss) in Angular 13 while upgrading project

Asked 2022-Jan-27 at 14:41

I am facing an issue while upgrading my project from angular 8.2.1 to angular 13 version.

After a successful upgrade while preparing a build it is giving me the following error.

1Data path "" must NOT have additional properties(extractCss).
2

I already renamed styleext with style in the angular.json file, but still not able to find the root cause for this error.

angular.json file is as follows.

1Data path "" must NOT have additional properties(extractCss).
2  {
3  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
4  "version": 1,
5  "newProjectRoot": "projects",
6  "projects": {
7    "qiwkCollaborator": {
8      "projectType": "application",
9      "schematics": {
10        "@schematics/angular:component": {
11          "style": "scss"
12        }
13      },
14      "root": "",
15      "sourceRoot": "src",
16      "prefix": "app",
17      "architect": {
18        "build": {
19
20        /*  "configurations": {
21            "fr": {
22            "aot": true,
23            "outputPath": "dist/qwikCollaborator/fr/",
24            "i18nFile": "src/translate/messages.fr.xlf",      
25            "i18nFormat": "xlf",      
26            "i18nLocale": "fr",      
27            "i18nMissingTranslation": "error"    
28             },
29             "en": {
30            "aot": true,
31            "outputPath": "dist/qwikCollaborator/en/",
32            "i18nFile": "src/translate/messages.en.xlf",      
33            "i18nFormat": "xlf",      
34            "i18nLocale": "en",      
35            "i18nMissingTranslation": "error"    
36             }  
37           },*/
38          "builder": "@angular-devkit/build-angular:browser",
39          "options": {
40            "outputPath": "dist/qiwkCollaborator",
41            "index": "src/index.html",
42            "main": "src/main.ts",
43            "polyfills": "src/polyfills.ts",
44            "tsConfig": "tsconfig.app.json",
45            "aot": false,
46            "assets": [
47              "src/favicon.ico",
48              "src/assets"
49            ],
50            "styles": [
51              "src/styles.scss",
52              "src/assets/css/custom-mobile.css",
53              "src/assets/css/custom.css"
54            ],
55            "scripts": [
56              "node_modules/jquery/dist/jquery.min.js",
57              "src/assets/js/qwikCollaborator.js"
58            ]
59          },
60          "configurations": {
61          "es5": {
62        "tsConfig": "./tsconfig.es5.json"
63      },
64            "production": {
65              "fileReplacements": [
66                {
67                  "replace": "src/environments/environment.ts",
68                  "with": "src/environments/environment.prod.ts"
69                }
70              ],
71              "optimization": true,
72              "outputHashing": "all",
73              "sourceMap": false,
74              "extractCss": true,
75              "namedChunks": false,
76              "aot": true,
77              "extractLicenses": true,
78              "vendorChunk": false,
79              "buildOptimizer": true,
80              "budgets": [
81                {
82                  "type": "initial",
83                  "maximumWarning": "2mb",
84                  "maximumError": "5mb"
85                },
86                {
87                  "type": "anyComponentStyle",
88                  "maximumWarning": "6kb",
89                  "maximumError": "10kb"
90                }
91              ]
92            }
93          }
94        },
95        "serve": {
96         /*  "configurations": {
97            "fr": {
98            "browserTarget": "qwikCollaborator:build:fr" 
99            },
100            "en": {
101            "browserTarget": "qwikCollaborator:build:en" 
102            } ,
103            },*/
104          "builder": "@angular-devkit/build-angular:dev-server",
105          "options": {
106            "browserTarget": "qiwkCollaborator:build"
107          },
108         
109          "configurations": {
110          "es5": {
111        "browserTarget": "qiwkCollaborator:build:es5"
112      },
113            "production": {
114              "browserTarget": "qiwkCollaborator:build:es5"
115            }
116          }
117        },
118        "extract-i18n": {
119          "builder": "@angular-devkit/build-angular:extract-i18n",
120          "options": {
121            "browserTarget": "qiwkCollaborator:build"
122          }
123        },
124        "test": {
125          "builder": "@angular-devkit/build-angular:karma",
126          "options": {
127            "main": "src/test.ts",
128            "polyfills": "src/polyfills.ts",
129            "tsConfig": "tsconfig.spec.json",
130            "karmaConfig": "karma.conf.js",
131            "assets": [
132              "src/favicon.ico",
133              "src/assets"
134            ],
135            "styles": [
136              "src/styles.scss"
137            ],
138            "scripts": ["../node_modules/jspdf/dist/jspdf.min.js"]
139          }
140        },
141        "lint": {
142          "builder": "@angular-devkit/build-angular:tslint",
143          "options": {
144            "tsConfig": [
145              "tsconfig.app.json",
146              "tsconfig.spec.json",
147              "e2e/tsconfig.json"
148            ],
149            "exclude": [
150              "**/node_modules/**"
151            ]
152          }
153        },
154        "e2e": {
155          "builder": "@angular-devkit/build-angular:protractor",
156          "options": {
157            "protractorConfig": "e2e/protractor.conf.js",
158            "devServerTarget": "qiwkCollaborator:serve"
159          },
160          "configurations": {
161            "production": {
162              "devServerTarget": "qiwkCollaborator:serve:production"
163            }
164          }
165        }
166      }
167    }},
168  "defaultProject": "qiwkCollaborator"
169}
170

How to get rid of this additional property?

can anyone help me with this?

thanks in advance!

ANSWER

Answered 2021-Dec-14 at 12:45

Just remove the "extractCss": true from your production environment, it will resolve the problem.

The reason about it is extractCss is deprecated, and it's value is true by default. See more here: Extracting CSS into JS with Angular 11 (deprecated extractCss)

Source https://stackoverflow.com/questions/70344098

QUESTION

Flutter Web: Cannot scroll with mouse down (drag) (Flutter 2.5+)

Asked 2022-Jan-19 at 09:57
[Update]

I can confirm this issue happened in flutter above 2.5. Using 2.2.3 is fine. The question becomes why this feature been removed in 2.5 ? And how to enable it in flutter 2.5?

[Origin Question]

I'm using SingleChildScrollView on flutter web with desktop browser. Scrolling only works on mouse wheel but not on mouse click (drag). How can I map mouse click to touch and scroll like mobile?

1import 'package:flutter/material.dart';
2
3void main() {
4  runApp(const MyApp());
5}
6
7class MyApp extends StatelessWidget {
8  const MyApp({Key? key}) : super(key: key);
9  @override
10  Widget build(BuildContext context) {
11    return MaterialApp(
12      title: 'Flutter Demo',
13      theme: ThemeData(
14        primarySwatch: Colors.blue,
15      ),
16      home: SingleChildScrollView(
17        child: Column(
18          children: List<Widget>.generate(50, (i) => Text(i.toString())).toList(),
19        ),
20      ),
21    );
22  }
23}
24
1import 'package:flutter/material.dart';
2
3void main() {
4  runApp(const MyApp());
5}
6
7class MyApp extends StatelessWidget {
8  const MyApp({Key? key}) : super(key: key);
9  @override
10  Widget build(BuildContext context) {
11    return MaterialApp(
12      title: 'Flutter Demo',
13      theme: ThemeData(
14        primarySwatch: Colors.blue,
15      ),
16      home: SingleChildScrollView(
17        child: Column(
18          children: List<Widget>.generate(50, (i) => Text(i.toString())).toList(),
19        ),
20      ),
21    );
22  }
23}
24flutter doctor -v
25[āœ“] Flutter (Channel master, 2.6.0-6.0.pre.6, on Ubuntu 20.04.3 LTS 5.11.0-34-generic, locale en_US.UTF-8)
26    ā€¢ Flutter version 2.6.0-6.0.pre.6 at /home/XXX
27    ā€¢ Upstream repository https://github.com/flutter/flutter.git
28    ā€¢ Framework revision 0c5431d99c (12 days ago), 2021-09-05 22:31:02 -0400
29    ā€¢ Engine revision b9c633900e
30    ā€¢ Dart version 2.15.0 (build 2.15.0-82.0.dev)
31
32[āœ“] Chrome - develop for the web
33    ā€¢ Chrome at google-chrome
34
35[āœ“] Connected device (2 available)
36    ā€¢ Linux (desktop) ā€¢ linux  ā€¢ linux-x64      ā€¢ Ubuntu 20.04.3 LTS 5.11.0-34-generic
37    ā€¢ Chrome (web)    ā€¢ chrome ā€¢ web-javascript ā€¢ Google Chrome 93.0.4577.82
38

ANSWER

Answered 2021-Sep-18 at 12:19

Flutter change mouse scroll behavior after 2.5. See this for detail.

1import 'package:flutter/material.dart';
2
3void main() {
4  runApp(const MyApp());
5}
6
7class MyApp extends StatelessWidget {
8  const MyApp({Key? key}) : super(key: key);
9  @override
10  Widget build(BuildContext context) {
11    return MaterialApp(
12      title: 'Flutter Demo',
13      theme: ThemeData(
14        primarySwatch: Colors.blue,
15      ),
16      home: SingleChildScrollView(
17        child: Column(
18          children: List<Widget>.generate(50, (i) => Text(i.toString())).toList(),
19        ),
20      ),
21    );
22  }
23}
24flutter doctor -v
25[āœ“] Flutter (Channel master, 2.6.0-6.0.pre.6, on Ubuntu 20.04.3 LTS 5.11.0-34-generic, locale en_US.UTF-8)
26    ā€¢ Flutter version 2.6.0-6.0.pre.6 at /home/XXX
27    ā€¢ Upstream repository https://github.com/flutter/flutter.git
28    ā€¢ Framework revision 0c5431d99c (12 days ago), 2021-09-05 22:31:02 -0400
29    ā€¢ Engine revision b9c633900e
30    ā€¢ Dart version 2.15.0 (build 2.15.0-82.0.dev)
31
32[āœ“] Chrome - develop for the web
33    ā€¢ Chrome at google-chrome
34
35[āœ“] Connected device (2 available)
36    ā€¢ Linux (desktop) ā€¢ linux  ā€¢ linux-x64      ā€¢ Ubuntu 20.04.3 LTS 5.11.0-34-generic
37    ā€¢ Chrome (web)    ā€¢ chrome ā€¢ web-javascript ā€¢ Google Chrome 93.0.4577.82
38class MyCustomScrollBehavior extends MaterialScrollBehavior {
39  // Override behavior methods and getters like dragDevices
40  @override
41  Set<PointerDeviceKind> get dragDevices => { 
42    PointerDeviceKind.touch,
43    PointerDeviceKind.mouse,
44    // etc.
45  };
46}
47
48// ScrollBehavior can be set for a specific widget.
49final ScrollController controller = ScrollController();
50ScrollConfiguration(
51  behavior: MyCustomScrollBehavior(),
52  child: ListView.builder(
53    controller: controller,
54    itemBuilder: (BuildContext context, int index) {
55     return Text('Item $index');
56    }
57  ),
58);
59

Source https://stackoverflow.com/questions/69232764

QUESTION

clarity.js by Microsoft slowing overall page loads

Asked 2022-Jan-17 at 16:40

I have a customer using bing tracking via https://bat.bing.com/bat.js.

On December, 6th 2021 it started calling in clarity.js without the customer making any changes to their code.

This slowed the overall page load by 1 second on mobile and 500ms on desktop. I've been trying to figure out how to disable this JS but I'm not sure what to do as it's being fired from the bing tracking js.

The bing tracking code is being triggered via google tag manager.

Anyone else having this issue and know how to disable clarity.js from being called at all?

enter image description here

Customer is using Wordpress. Amazing Bing can implement code that slows down a site overall page speed without any notification to the customer.

ANSWER

Answered 2021-Dec-17 at 18:16

We figured this out by going into our bing web tools and disabling the Clarity integration.

Source https://stackoverflow.com/questions/70281265

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Mobile

Tutorials and Learning Resources are not available at this moment for Mobile

Share this Page

share link

Get latest updates on Mobile