congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RateThisApp.onStart
Code IndexAdd Tabnine to your IDE (free)

How to use
onStart
method
in
com.kobakei.ratethisapp.RateThisApp

Best Java code snippets using com.kobakei.ratethisapp.RateThisApp.onStart (Showing top 3 results out of 315)

origin: kobakei/Android-RateThisApp

@Test
public void onStart_isSuccess() {
  Context context = RuntimeEnvironment.application.getApplicationContext();
  RateThisApp.onStart(context);
  SharedPreferences sharedPreferences = RuntimeEnvironment.application.getSharedPreferences(
      PREF_NAME, Context.MODE_PRIVATE);
  // check if install date is stored
  long expectedInstallDate = 0L;
  PackageManager packMan = context.getPackageManager();
  try {
    PackageInfo pkgInfo = packMan.getPackageInfo(context.getPackageName(), 0);
    expectedInstallDate = new Date(pkgInfo.firstInstallTime).getTime();
  } catch (PackageManager.NameNotFoundException e) {
    e.printStackTrace();
  }
  Assert.assertEquals(expectedInstallDate, sharedPreferences.getLong(KEY_INSTALL_DATE, 0L));
  // check if launch time is incremented
  Assert.assertEquals(1, sharedPreferences.getInt(KEY_LAUNCH_TIMES, 0));
}
origin: kobakei/Android-RateThisApp

@Test
public void shouldRateDialogIfNeeded_LaunchTimeIsCorrect() {
  Context context = RuntimeEnvironment.application.getApplicationContext();
  RateThisApp.init(new RateThisApp.Config(1, 3));
  RateThisApp.onStart(context);
  Assert.assertFalse(RateThisApp.shouldShowRateDialog());
  RateThisApp.onStart(context);
  Assert.assertFalse(RateThisApp.shouldShowRateDialog());
  RateThisApp.onStart(context);
  Assert.assertTrue(RateThisApp.shouldShowRateDialog());
  RateThisApp.onStart(context);
  Assert.assertTrue(RateThisApp.shouldShowRateDialog());
}
origin: kobakei/Android-RateThisApp

@Test
public void getLaunchCount_IsCorrect() {
  Context context = RuntimeEnvironment.application.getApplicationContext();
  Assert.assertEquals(0, RateThisApp.getLaunchCount(context));
  RateThisApp.onStart(context);
  Assert.assertEquals(1, RateThisApp.getLaunchCount(context));
  RateThisApp.onStart(context);
  Assert.assertEquals(2, RateThisApp.getLaunchCount(context));
}
com.kobakei.ratethisappRateThisApponStart

Javadoc

This API is deprecated. You should call onCreate instead of this API in Activity's onCreate().

Popular methods of RateThisApp

  • onCreate
    Call this API when the launcher activity is launched. It is better to call this API in onCreate() of
  • showRateDialogIfNeeded
    Show the rate dialog if the criteria is satisfied.
  • init
    Initialize RateThisApp configuration.
  • showRateDialog
  • shouldShowRateDialog
    Check whether the rate dialog should be shown or not. Developers may call this method directly if th
  • stopRateDialog
    Stop showing the rate dialog
  • getLaunchCount
    Get count number of the rate dialog launches
  • log
    Print log if enabled
  • printStatus
    Print values in SharedPreferences (used for debug)
  • setCallback
    Set callback instance. The callback will receive yes/no/later events.
  • setOptOut
    Set opt out flag. If it is true, the rate dialog will never shown unless app data is cleared. This m
  • storeInstallDate
    Store install date. Install date is retrieved from package manager if possible.
  • setOptOut,
  • storeInstallDate

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now