Conference-app-2020: Handle *not found* external integrations like a Calendar app

Created on 24 Jan 2020  Β·  4Comments  Β·  Source: DroidKaigi/conference-app-2020

Kind (Required)

  • Improvement

    Overview (Required)

Not yet merged but https://github.com/DroidKaigi/conference-app-2020/pull/307/files#diff-2b4a7fcb147ae35e0c939da24e583057R33 will throw ActivityNotFoundException if no calendar app has been installed to your device.
We haven't provided a way to handle such a situation, but I believe that it would be great to show a warning and not to exit from an application.

The base strategy is like the following.

  • Add new AppError-inherited class that represents an error happens on between our app and external integrations e.g. it's ExtenalIntegrationError extends AppError
  • Define new ExtenalIntegrationError classes for each integration. For exmaple, it's better to add new NoCalendarIntegrationFoundException which extends ExtenalIntegrationError for the calendar app integration
  • Pass an exception to SystemViewModel#onError at least on Android module
fun openCalendar(calendarImplicitIntent: Intent) {
  try {
    activity.startActivity(implicitIntent)
  } catch (e: ActivityNotFoundException) {
    onError(NoCalendarIntegrationFoundException(e))
  }
}

Please note that this example may not be compile-able because it's kinda pseudo code.

## Links

easy welcome contribute

All 4 comments

I will try this :raising_hand:

@k-tomoyasu
I assigned this issue to you. Thank you so much. Please feel free to ask us if you have any questions.

The warning message would be like below.

  • No calendar application was found. for English
  • カレンダーをプγƒͺγŒθ¦‹γ€γ‹γ‚ŠγΎγ›γ‚“γ§γ—γŸ for Japanese

@k-tomoyasu
For your information, #307 has been merged into master branch.

Thanks for information, sorry for my late reply.
I will try this weekend!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alto-tone picture alto-tone  Β·  6Comments

roana0229 picture roana0229  Β·  6Comments

ry-itto picture ry-itto  Β·  4Comments

rmakiyama picture rmakiyama  Β·  6Comments

rkonno picture rkonno  Β·  5Comments