1

I have implemented card.io into an app and the performance when opening the credit card scanning activity (CreditIOActivity) opens quickly on most devices. But on the Nexus 10, running Android 4.4.2, it can take as much as 5 seconds for the scanning activity to load when called from my app. Though this long delay does NOT occur in the sample app card.io provides with their SDK. I am thinking it may be a memory issue causing the slow load time when opening from within my app, but that does not explain why the performance is near identical to the sample app on other devices.

All help is greatly appreciated.

Dick Lucas
  • 12,289
  • 14
  • 49
  • 76

2 Answers2

2

Are you checking CardIOActivity.canReadCardWithCamera(this) in your activity's onResume() or similar? There's some static initialization that card.io needs. If it can be triggered early, it doesn't have to happen when the user is waiting.

tomwhipple
  • 2,850
  • 27
  • 28
  • @timwhipple, thank you sir. This greatly improves the opening of the activity in portrait mode, but for some reason it is still very slow when opening the activity in landscape mode. Any ideas Tom? – Dick Lucas Jun 13 '14 at 14:06
  • Is the same difference between landscape & portrait present on other devices? What about the sample app on your Nexus 10? – tomwhipple Jun 13 '14 at 15:45
  • It behaves fine in other devices. And the sample app performs fine in portrait and landscape. – Dick Lucas Jun 20 '14 at 01:21
1

The SampleApp does indeed experience the same performance problems, it just does it on app startup. CardIOActivity.canReadCardWithCamera(this) can take up to 4 seconds on the Nexus 10. I fiddled around and found that calling CardIOActivity.canReadCardWithCamera(this) on an AsyncTask greatly improves the user experience. I recommend starting the AsyncTask when a user enters the activity immediately before they would be asked to scan a card. Even earlier would be more ideal, but becomes harder to manage.

In the case that the user attempts to scan a card before this method returns, Card.io gracefully falls back to manual entry.

Jeff Brateman
  • 3,229
  • 2
  • 20
  • 26