Coder Social home page Coder Social logo

updateme-android's Introduction

UpdateMe

A powerful force update library for Android

alt text

For more information please see the website

Download

Download the latest JAR or grab via Gradle. (Project's gradle file): This project uses Firebase remote config feature. Because of this reason you need to add google services into your project.

dependencies {
  compile 'io.salyangoz.updateme:updateme:0.1.0'
}
apply plugin: 'com.google.gms.google-services'

or Maven:

<dependency>
  <groupId>io.salyangoz.updateme</groupId>
  <artifactId>updateme</artifactId>
  <version>0.1.0</version>
</dependency>

Snapshots of the development version are available in Sonatype's snapshots repository.

Dependencies (Google Services)

Grab via Gradle: (Add it to project's main gradle file)

dependencies {
  classpath 'com.google.gms:google-services:3.1.0'
}

Introduction

  1. Create Firebase project http://firebase.google.com
  2. Firebase will give you google-services.json file. Paste this file into your projects root directory.
  3. In the left menu choose remote config and add these parameters.
  4. Add these parameters
Parameter Key Default Value
android_update_me_required Do you want to force update App (Ex: false
android_update_me_current_version The version of your app(Ex: 1.0.0)
android_update_me_store_url The store url(Ex: http://play.google.com/store/apps/com.salyangoz.torrentfinder)
android_update_me_dialog_title Update dialog title(You can leave blank)
android_update_me_dialog_description Update dialog message(You can leave blank)
  1. Publish Changes (Top right corner)

Usage

Basic Usage
UpdateMe.with(this).check();
Advanced Usage

Features

  1. Set dialog visibility
  2. Add listeners to Positive and Negative button clicks.
  3. Set positive and negative button text and colors.
  4. Set custom icon
UpdateMe.with(this, 30).setDialogVisibility(true)
                .continueButtonVisibility(true)
                .setPositiveButtonText("MF Go!")
                .setNegativeButtonText("Oh No...")
                .setDialogIcon(R.drawable.common_google_signin_btn_icon_dark)
                .onNegativeButtonClick(new OnNegativeButtonClickListener() {

                    @Override
                    public void onClick(LovelyStandardDialog dialog) {

                        Log.d(UpdateMe.TAG, "Later Button Clicked");
                        dialog.dismiss();
                    }
                })
                .onPositiveButtonClick(new OnPositiveButtonClickListener() {

                    @Override
                    public void onClick(LovelyStandardDialog dialog) {

                        Log.d(UpdateMe.TAG, "Update Button Clicked");
                        dialog.dismiss();
                    }
                })
                .check();

Special Thanks

Custom alert dialogs pulled from LovelyDialog for Android repository. https://github.com/yarolegovich/LovelyDialog

License

Copyright 2017 Salyangoz Teknoloji, Inc.

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.

updateme-android's People

Contributors

hatimhoho avatar salyangoz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

updateme-android's Issues

FATAL EXCEPTION: AsyncTask #5

FATAL EXCEPTION: AsyncTask #5
Process: com.skiplone.skiplone, PID: 18392
java.lang.NoSuchFieldError: No static field zzcsl of type Ljava/lang/Object; in class Lcom/google/android/gms/internal/adn; or its superclasses (declaration of 'com.google.android.gms.internal.adn' appears in /data/app/com.skiplone.skiplone-3/base.apk)
at com.google.android.gms.internal.abq.zzKM(Unknown Source)
at com.google.android.gms.internal.abp.(Unknown Source)
at com.google.android.gms.internal.abg.run(Unknown Source)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)

NPE crash, listener is not optional

Crashes on "update" click when listeners are not set.

java.lang.NullPointerException: Attempt to invoke interface method 'void io.salyangoz.updateme.listener.OnPositiveButtonClickListener.onClick(com.yarolegovich.lovelydialog.LovelyStandardDialog)' on a null object reference
at io.salyangoz.updateme.UpdateMe$1.onClick(UpdateMe.java:141)

FAILURE: Build failed with an exception.

I'm trying to add your library to my app, but unfortunately i can't compile it anymore as soon as i include your library (using classpath 'com.google.gms:google-services:3.1.1', though).

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> Unexpected inputs: ImmutableJarInput{name=io.salyangoz.updateme:updateme:0.1.0, file=E:\Work\AndroidStudio\org.faked.isms2droid\app\build\intermediates\transforms\desugar\debug\2.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.yarolegovich:lovely-dialog:1.0.7, file=E:\Work\AndroidStudio\org.faked.isms2droid\app\build\intermediates\transforms\desugar\debug\7.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-config:11.0.2, file=E:\Work\AndroidStudio\org.faked.isms2droid\app\build\intermediates\transforms\desugar\debug\27.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}

* Try:
Run with --debug option to get more log output.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:63)
	at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
	at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
	at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:124)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:105)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:99)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)
	at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:99)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Unexpected inputs: ImmutableJarInput{name=io.salyangoz.updateme:updateme:0.1.0, file=E:\Work\AndroidStudio\org.faked.isms2droid\app\build\intermediates\transforms\desugar\debug\2.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.yarolegovich:lovely-dialog:1.0.7, file=E:\Work\AndroidStudio\org.faked.isms2droid\app\build\intermediates\transforms\desugar\debug\7.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-config:11.0.2, file=E:\Work\AndroidStudio\org.faked.isms2droid\app\build\intermediates\transforms\desugar\debug\27.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}
	at com.google.common.base.Preconditions.checkState(Preconditions.java:456)
	at com.android.build.gradle.internal.transforms.InstantRunTransform.transform(InstantRunTransform.java:174)
	at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
	at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
	at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
	at sun.reflect.GeneratedMethodAccessor362.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:173)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
	at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:121)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:122)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:197)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:107)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:111)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
	... 30 more


* Get more help at https://help.gradle.org

BUILD FAILED in 27s

only update option

how can i give only one option of "update" rather than both update and later?

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.