Giter Club home page Giter Club logo

android-dev-tools's Introduction

Android Dev Tools

Android Dev Tools is a library that contains various QA/Debug tools to speed up and streamline the development progress.

License Maven Central Maven Central Maven Central Maven Central Maven Central

Tools

Autofill Service

Autofill Service allows developers and QA to fill form inputs automatically with predefined form data.

How it Works?

It observes both activity and fragment lifecycle events via application class to detect layout inflations. After each inflation, it seeks for determined input views in the inflated layout. If it has all required inputs, then shows the autofill action. Autofill data that suitable with inflated form inputs are shown in the selection dialog.

Demo

Usage

AutofillService.Builder(this)
    .withFilePath("autofill.json")
    .build()

Configuration

Configuration Json file can be located in /debug/assets folder. You can define autofill data by following this structure. You should also note that the order of the defined form field resource id's and order of input values must match.

{
  "forms": [
    {
      "fields": ["inputEmail", "inputPassword"], // Form input resource id's
      "categories": {
        "Temporary Users": [
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] },
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] },
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] },
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] }
        ],
        "Test Users": [
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] },
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] },
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] },
          { "description": "Has more then one order history.", "values": ["[email protected]", "123456"] }
        ]
      }
    }
  ]
}

Setup

"com.trendyol.android.devtools:autofill-service:$version"
"com.trendyol.android.devtools:autofill-service-no-op:$version"

Maven Central

Analytics Logger

Analytics Logger allows to log & inspect analytics events sent by client.

Demo

Usage

AnalyticsLogger.init(applicationContext)

AnalyticsLogger.report(
    key = "eventKey",
    value = "{\"category\": \"Cart\", \"data\": \"TestData\" }", // Should be Json string.
    platform = "EventPlatform",
)

Setup

"com.trendyol.android.devtools:analytics-logger:$version"
"com.trendyol.android.devtools:analytics-logger-no-op:$version"

Maven Central

Http Inspector (Alpha)

Http Inspector provides an OkHttp interceptor and web interface to inspect, manipulate in realtime and mock HTTP request and responses.

You can access the web client with http://deviceip:5001. If you are running on virtual a device, you need to forward port by adb forward tcp:5001 tcp:5001.

How it Works

Any request passing through the interceptor is held in the request queue to sync with each other. Held requests are being sent to the web interface via Ktor local webserver. After doing any changes in the response data using web interface, it waits for the acceptance, then sends manipulated response back to the request queue. The actual response data is replaced with the manipulated one and reflected to the application.

Mocking Requests

With this feature, we can imitate the API by preparing mock request and response data for the REST API that has not been prepared yet. It provides a web interface where we can create mock request and response data, and allows us to enable/disable the previously added mock data. The point to be considered is which requests will be answered with mock data rather than going to the real API is decided by comparing the URL, method and request body data of the request in the real request and mock data. If this data is completely matched, the mock response will be served to the client.

Usage

val client = OkHttpClient.Builder()
    .addInterceptor(MockInterceptor(context))
    .build()

Setup

"com.trendyol.android.devtools:http-inspector:$version"
"com.trendyol.android.devtools:http-inspector-no-op:$version"

Maven Central

Environment Manager

Environment Manager provides environment selection dialog can be opened from the app notifications with predefined environment data.

Setup

"com.trendyol.android.devtools:environment-manager:$version"

Maven Central

Debug Menu

Debug Menu provides a debug page build with predefined custom action and events.

Setup

"com.trendyol.android.devtools:debug-menu:$version"

Maven Central

License

Copyright 2022 Trendyol.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-dev-tools's People

Contributors

ibrahimsn98 avatar mucahidkambur avatar mertnyuksel avatar bilgehankalkan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.