Code Monkey home page Code Monkey logo

register's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

register's Issues

Companion app corrupt

Tried to install the companion app on three different devices via different acquisition channels:

  • direct download from GH website
  • download to laptop and then file transfer to devices

All devices allow sideloading, the ones on A8 and A9 are just saying that the app wasn't installed. My A7 device with Lineage additionally states the package appears to be corrupt.

Am I missing something here?

Documentation mistype

in README.MD the "'com.nytimes.android.register:0.0.2'" is mistyped. The last dot have to be colon: "'com.nytimes.android:register:0.0.2'"

Automatically Deploy Config App

As of now, you have to separately install the config app in order to use register. If the version of Register you've coupled with your app is different than the version of the companion app, you can run into issues. If we can automatically deploy the config app with your app (like LeakCanary does), then that issue would be mitigated and would be a nicer experience.

Crash app when run app.

App crash when i try to run. This is log file. And I can't install RegisterCompanion apk.

2018-11-02 18:00:31.550 20130-20130/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nytimes.android.external.register.sample, PID: 20130
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nytimes.android.external.register.sample/com.nytimes.android.external.register.sample.SampleActivity}: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3061)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821)
at android.os.Handler.dispatchMessage(Handler.java:114)
at android.os.Looper.loop(Looper.java:198)
at android.app.ActivityThread.main(ActivityThread.java:6716)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.get(ArrayList.java:437)
at com.android.billingclient.api.BillingClientTesting$BillingContextWrapper.bindService(BillingClientTesting.java:120)
at com.android.billingclient.api.BillingClientImpl.startConnection(BillingClientImpl.java:237)
at com.android.billingclient.api.BillingClientTesting.startConnection(BillingClientTesting.java:53)
at com.nytimes.android.external.registerlib.GoogleServiceProviderTesting.startConnection(GoogleServiceProviderTesting.java:37)
at com.nytimes.android.external.register.sample.SampleActivity.initGoogleServiceProvider(SampleActivity.java:189)
at com.nytimes.android.external.register.sample.SampleActivity.onCreate(SampleActivity.java:80)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2906)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3061) 
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1821) 
at android.os.Handler.dispatchMessage(Handler.java:114) 
at android.os.Looper.loop(Looper.java:198) 
at android.app.ActivityThread.main(ActivityThread.java:6716) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 

Rename "MainActivity" to "RegisterCompanionActivity"

Debugging the app is a bit difficult when in Flipper for example. Both Register's and a client's application could have "MainActivity" be the name of the Launcher activity.

Lets rename to something more descriptive (e.g. RegisterCompanionActivity)

Screen Shot 2020-04-22 at 1 35 29 PM

Add Products screen and ability to add / edit products

Work is being done in: feature/products_edit

Prelim work is being done in feature/products_edit. This work would require use register.json as a seed file for a database.

  • Since we store a product receipts, what happens when a product is edited?

  • Solution: Clone the product and mark as active and the source product is marked inactive. This will allow us to query for previous products (e.g. viewing the receipts). This has the added benefit to play nice with receipts once they are moved from strings into database entries. They are currently stored as strings in shared-prefs.

Migrate to AndroidX

Currently we're using Support 27.1.1, which is fine for now, but in order to move towards things like TestX it would be better if we fully moved over to AndroidX.

Mark all APP module resources as private

All resources in a library default to public. To make all resources implicitly private, you must define at least one specific attribute as public. Resources include all files in your project’s res/ directory, such as images. To prevent users of your library from accessing resources intended only for internal use, you should use this automatic private designation mechanism by declaring one or more public resources.

To declare a public resource, add a declaration to your library’s public.xml file. If you haven’t added public resources before, you need to create the public.xml file in the res/values/ directory of your library.

The following example code creates two public string resources with the names mylib_app_name and mylib_public_string:

Clean up config file deployment

Right now it can be a pain as you have to remember to push the updated version of the config file before you try to access it.

One possible idea is linked to #63, since the config app would be deployed with your app, you could include the config file in your app's source and Register reads from it there.

Also #11 would be nice :)

Companion app keeps crashing

After solving #59 with a new .apk file, the Compaion app keeps crashing on launch.

Behaviour:

Without register.json, app comes up fine and shows a text field prompting the user to put a register.json to sdcard/ .

Even with the provided json sample from the README page, the app crashes, doesn't even come up with any UI.

File content:

{
  "skus": {
    "register.sample.iap": {
      "type": "inapp",
      "price" : "1.00",
      "title" : "Sample In App Purchase Item",
      "description" : "This is an in app purchase item for use with Register sample app",
      "package" : "com.nytimes.android.external.register"
    },
    "register.sample.sub": {
      "type": "subs",
      "price" : "10.00",
      "title" : "Sample Subscription Item1",
      "description" : "This is a subscription item for use with Register sample app",
      "package" : "com.nytimes.android.external.register"
    }
  },
  "users": [
    "[email protected]",
    "[email protected]"
  ]
}

File name:

register.json

Location:

/sdcard

Merge library and "backend" app

Pain points of having the app separate from the library:

  1. We have to maintain 2 projects
  2. We have to provide a different APK every time
  3. Huge possibility of incompatibility if people don't update do the latest APK when we release a new version of the library

Possible solutions:

  • Like LeakCanary: 2 library projects, one for debug and one for release. Release version is a no-op, while debug is the fully fledged project. In this case, the changes to the codebase are minimal, we just need to include the app in the library and add a no-op version of the library, with a shared interface between the 2, so that the code does not need to be changed when the release app is loaded
  • Merge everything in a single library and play with flavours: this means we have a common source folder that contains the common interface, than we leverage the debug and release flavours so that the code is only present in the debug version. In this case, it means providing all our dependencies as debug only, and make sure we don't rely on the library BuildConfig.DEBUG flag but on the external app.

What do you think?

Register 1.0 Release Plan

Lets have a discussion talking about what we need to do to release 1.0 version of Register.

Most Important: Re-Add Tests (This is on NYT)

Additional?

  • Clean up config file deployment
  • Auto-Deploy Config app
  • AndroidX
  • Kotlin

Do we agree this is a minimum bar to get to 1.0 release? Do we disagree? Any suggestions?

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.