Version 0.9.0 comes with the new Restart Options plugin. There are now 10 plugins available in FAST SDK:
- View Inspector
- Resource Explorer
- Crash Info
- SharedPreferences Editor
- Network Inspector
- File Explorer
- Restart Options
Please visit the wiki for instructions about adding it to your project.
Restart options plugin
We all know how painful it might be to get a bug or a crash, and to have to kill the app, restart it and go back to our activity.
Even worse when you have to clear your app’s data to restart from a clean install. You have to go into the apps’s settings, go in the “Storage” settings then click on “Clear storage” and then confirm. And after all that, you still have to reopen your app.
This process is quite long and becomes quickly frustrating when you need to do it repeatedly for a more or less long period of time.
Well, this is no longer going to be an issue with the new Restart Options plugin. You will be able to make to do the whole “clear data & restart the app” in two quick shortcuts on your computer keyboard (provided that you are using the emulator, but it still going to be way faster on a regular device).
Just type “Q” (uppercase “q”, open the Restart Options plugin) followed by “g” (lowercase “g”, select option “Clear data & restart app“) and you’re done. Shouldn’t take you more than 2 seconds!
We tried to think about all the possible use cases that you might need regarding your app. So far, we’ve come up with 7 actions:
- Kill the activity: Sometimes, bad code can prevent you from closing properly your activity, like some bad condition in Activity.onBackPressed() for example. This option allows you to close your activity even for the ones that don’t want to
- Restart the activity with an empty intent (no data): To restart your activity with an intent that has no data whatsoever
- Restart the activity with the same intent (with the same intent data): To restart your activity using the exact same intent used to first open it. Intent data is preserved
- Kill the app: Because why not?
- Restart the app: Quicker than close/kill/reopen
- Clear data & kill the app: Quicker than minimize/browsing various settings/close
- Clear data & restart the app: Quicker than minimize/browsing various settings/reopen
Crash Info plugin update
The restart options were first available in the Crash Info plugin. We took the opportunity of the new Restart Options plugin to upgrade the options available in the Crash Info plugin, passing from 5 options to 8.
This way, if you ever encounter a crash, you will get all the available options directly. No need to call the Restart Options plugin.
The only caveat is that keyboard shortcuts are not available (yet, but we’re working on it).
Keep FAST preferences even with Clear data
Wouldn’t it be annoying if you were to lose all your preferences in the various plugins each time you had to do a hard reset (clear app data) of your app? We know it would.
That’s why when you’re using either the Restart Options or Crash Info plugins to clear your app’s data, we restore your preferences for all FAST plugins after clearing the data of the app.
Some nice magic we got. You’re welcome!
Introducing keyboard shortcut indicators
You might have noticed it in the previous screen, there are some small button-like items at the end of each item.
These are keyboard shortcut indicators. They will help you understand how you can quickly execute an action. For example, in the screen above you can execute “Kill activity” by typing “a” on your keyboard, or “Restart activity (same intent data)” by typing “c”.
While it might not be possible to display them everywhere (think of the toolbar icon buttons for example), we will do our best to make them available when possible on the existing and future plugins.
Please remember that keyboard shortcuts will not work on physical devices (unless you have some kind of screen mirroring app like Vysor for example).
Code generator / Code view is coming
We’ve been thinking about this feature for a long time and couldn’t resist starting working on it.
The idea is to be able to display snippets of code that you can directly copy from the app (if you’re using an emulator) and paste it in Android Studio (or your favorite IDE).
We wanted to be able to display formatted code in at least Kotlin, Java and XML. Other formats, like JSON and HTML for example, might be great too.
The code generator/code view could be integrated into many plugins. Like for example:
- View inspector: Display the code you need to apply on your view(s) based on the changes you’ve made on the layout/properties tabs (in Kotlin, Java, and XML when possible)
- View formatted JSON in a SharedPreferences String value
- View formatted JSON, XML or HTML in the Network Inspector Response body
- View formatted file’s content in the File Explorer plugin
- View code to create ColorStateList in the (future) ColorStateList Builder plugin
- View code to create a DrawableStateList in the (future) DrawableStateList Builder plugin
- View code to create animations in the (future) Animation Builder plugin
- View formatted SQL queries in the (future) Database Explorer plugin
- View code to launch an activity, service, broadcast, … in the (future) Intent Explorer plugin
- View code to apply fullscreen mode or light status bar in the UISystemFlags Editor plugin
- View code to get the device’s screen width in pixels (for example) in the Device/App Data plugin
- View code in yet not imagined plugin for like Firebase, Play Services or any third-party service or library…
As you can see, this feature will be very useful in a lot of tools to come. We are so excited to build this feature.
More to come this week
We hope to be able to release two new plugins before the end of the week. There are still a lot of tools to build for Android developers, and we can’t wait to see what you will be able to build on the future when the beta period is over.