Debugging

The most common thing that happens in app development is getting stuck because the

  • Controls are not showing up.
  • Actions are not working.
  • Data is not getting refreshed from the remote server
  • Data is not getting saved into the local database
  • You name it!!!

The app development time can be drastically cut down if you know how to come out of a stuck situation. AVM gives you 6 levels of reporting messages. These reporting levels are set in the res/string/values.xml (for Android) and TODO (for iOS).

0 = CRIT                // Critical: critical conditions
1 = ERR                 // Error: error conditions
2 = WARN                // Warning: warning conditions
3 = INFO                // Informational: informational messages
4 = DEBUG               // Debug: debug messages
5 = ADVANCED_DEBUG      // Debug: debug messages with stack trace
6 = VERBOSE             // Verbose: Show progress of activity life cycle and initiation of any action

Note

When you are developing the app, you can keep the Messages Reporting Level at 6 and before releasing the app to the market place, it can be reduced to 2.

How to view messages?

  • Android

Open the view “logcat”. You can open the view by going to the menu Windows | Show View | Other. In the dialog box “Show View”, open the folder “Android” and select “logcat”. All messages are shown in the logcat view. TODO - Show picture of the dialog “Show View”.

  • iOS

TODO

Screen LifeCycle and the Messages

The messages are displayed around the screen life cycle. As soon as the screen is created and until it gets destroyed message depict the screen lifecycle.

Information Message When does it come?
Screen created: <screen name> When the screen is being created and before the controls have been placed on the screen.
Resuming Screen: <screen name> With local data source is : <local data source> And the remote data source is : <remote data source> When the screen resumes. Screen resumes after getting created and when it is shown again after it has gone in the background. A screen goes in the background if another screen covers it or if the user presses the home button or switches to another application.
Destroying Screen: <screen name> When the screen has been destroyed.
Calling action <action name>. On View: <view name> with target: <target name>. Params: <list of parameter values> When the action is executed upon the occurrance of the event on which it is tied to.
The URL: <url name> took: <retrieval time> ms for fetching the response. When the remote data source is called. Remote Data Sources are called when the screen resumes or when action CALL_URL executes.

Most Common Error Messages

Most common Error Message When does it come? Suggestions on next step
Error in finding system database. Please check res/values/strings.xml for system_dbname and content_dbname. Make sure they are present in the assets folder. Aborting... Before creating the screen. Check the system database name. Android: <root folder>/res/strings/values.xml iOS:
Error in fetching data for screen: <screen name>. Aborting... Before creating the screen. If this is the starting screen, check the element attribute “start_screen_name” in the element <screen_deck>. Or check the attribute “target” in the action NEXT_SCREEN.
Unable to create layout for screen: <screen name> If the control creation fails. Check the messages that are shown on the control while compiling the XML files.
Cannot create control as its type is missing: <control name> While creating controls First get the screen name for which this error is being generated. Check the attribute “type” of the <control> element.
Cannot create control. Unable to find implementation class for type: <control type> While creating controls First get the screen name for which this error is being generated. Check the attribute “type” of the <control> element. If you are using plugins, please make sure that that library is included in your project.
While executing action: <action_name>, unable to find value for the parameter: <parameter name> While trying to execute an action. Check the parameter name used in the action. It should be valid field_name assigned to a control in the screen or a global property <GLOBAL:parameter_name> or a SQL query to fetch data from local database.
While executing action: <action_name>, unable to find Global Property: <global property name> While trying to execute an action. Check the global parameter name used in the action.
Error executing an action: <action_name>. ParameterList: <list of params> While executing actions. Check the name of the action. It must be one of the pre-defined Actions in AVM or the plugins that you are using as the library. Check if you included the plugin that you intent to use.
Error in validating data for control: <control name> While executing actions and retrieving values from controls Check the data_type and size for the control in question. If the control name looks unknown in the error message, then assign the control name in your XML file.
Unable to create a cursor for the query: <query name> While fetching local data Check the syntax of the query assigned to the local_data_source.
Unable to parse JSON response for url: <remote data resource> While parsing the response received after callign remote data source or executing the action CALL_URL. Check the server response if it returns a valid JSON response
Unable to save JSON object into database returned from url: <url>
While trying to save JSON data retreived
the content database.
Check if the database structure matches the JSON response. The JSON object name must match the table name. The key / value pairs of the JSON object must match the columns of the table.