MobileDeepLinking-Android


Source link: https://github.com/mobiledeeplinking/mobiledeeplinking-android

This Repository is no longer maintained.

Issue reports and pull requests will not be attended.

MobileDeepLinking-Android

This project is the Android component of the MobileDeepLinking specification, the industry standard for mobile application deeplinking. This spec and accompanying libraries simplify and reduce implementation time of deep links as well as provide flexible and powerful features for routing to custom behavior.

Features

Give a configuration file ( MobileDeepLinkingConfig.json), this library provides the ability to define deeplink routes that map to custom logic and activity creation. This is accomplished through custom callback handlers and by creating Intent objects that are used to start new activities.

Activity Routing

When a class is defined in the configuration file, the library will create an Intent that will be used to start the appropriate Activity. The route parameters defined in the configuration file (path and query parameters) will be set as extras on the intent. The class attribute in the json configuration must be a fully qualified class name with package info included.

Handlers

There may be cases where you wish to do more than simply route to an Activity. This functionality is supported through the use of custom handlers. In your subclass of the Application class, you can implement the org.mobiledeeplinking.android.Handler interface in order to register custom logic to be executed when a route matches. This association takes place in the configuration json under the handlers attribute.

These handlers are provided with a HashMap<String, String> with all route parameters found in the deeplink. The handlers can modify the contents of this map, which will then be forwarded on to the next handler in the handlers array found in the json. Handlers can be reused across multiple routes and can be used in conjunction with view instantiation or entirely on their own.

Compatibility

Supports Android 2.2 and above.

Build

Development uses the Gradle build system introduced with Android Studio. To build for release:

  1. ./gradlew clean assembleRelease
  2. The resulting library can be found in MobileDeepLinking-Android-SDK/build/libs/MobileDeepLinking-Android-SDK.aar.
  3. If you wish to build the library in a jar, execute ./gradlew clean packageReleaseJar
  4. The resulting jar can be found in MobileDeepLinking-Android-SDK/build/bundles/release/classes.jar. Rename this file to MobileDeepLinking-Android-SDK.jar.

Installation

Required

Create a MobileDeepLinkingConfig.json file in your project with desired routes and options. See demo app and spec for the schema and examples.

Drop the MobileDeepLinking-Android-SDK .aar or .jar file into your libs/ folder.

Insert the following into your AndroidManifest.xml:

<activity
  android:name="org.mobiledeeplinking.android.MobileDeepLinking"
  android:theme="@android:style/Theme.NoDisplay"
  android:noHistory="true">
  <intent-filter>

<data android:scheme="{
DEEP_LINK_SCHEME
}
"/>

<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.VIEW" />

<category android:name="android.intent.category.DEFAULT" />

<category android:name="android.intent.category.BROWSABLE" />
  </intent-filter> </activity> 

Where { DEEP_LINK_SCHEME } is replaced with your desired scheme. For example, replacing it with mdldemo would map the url scheme mdldemo:// to your app.

Optional

Register Custom Handlers (if desired) in a subclass of your app's Application class:

public class MDLApplication extends Application {

  @Override
  public void onCreate()
  {

super.onCreate();

MobileDeepLinking.registerHandler("testHandler", new org.mobiledeeplinking.android.Handler()

{

 @Override

 public Map<String, String> execute(Map<String, String> routeParameters)

 {

  // inside handler

  return routeParameters;

 
}

}
);

  
}
 
}
 

Demo App

Part of the MobileDeepLinking-Android.iml project consists of a demo app, MobileDeepLinking-Android-Demo. This is a demo application that provides an example implementation of the MobileDeepLinkingConfig.json file, along with several custom handlers that demonstrate how to route to client-specified functionality. It also provides example routing to several different activities.

License

Copyright 2014 MobileDeepLinking.org and other contributors http://mobiledeeplinking.org

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Resources

Thrifty is an implementation of the Apache Thrift software stack for Android.

Thrift is a widely-used cross-language service-definition software stack, with a nifty interface definition language from which to generate types and RPC implementations. Unfortunately for Android devs, the canonical implementation generates very verbose and method-heavy Java code, in a manner that is not very Proguard-friendly.

This is a simple EditText which fades at the end when text goes beyond the screen.

An RxJava transformer which combines replay, publish, and refCount operators.

An implement of RecyclerView with HeaderViews.

A ListView with "floor animation".

This library for Android projects adds Greasemonkey-compatible user script support to standard WebView components.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes