Development Notes

<!DOCTYPE html>

plutoscript/4_development_notes.md at a999911612f75d4ac9a528475add85f05b9e778f · Prof-Greipl/plutoscript Skip to content

Edit status

 Could not update your status, please try again. 80 remaining

Suggestions:

🌴 On vacation 🤒 Out sick 🏠 Working from home 🎯 Focusing Busy

When others mention you, assign you, or request your review, GitHub will let them know that you have limited availability. Clear status Never

Learn Git and GitHub without any code!

Using the Hello World guide, you’ll start a branch, write comments, and open a pull request. Read the guide

  • Unwatch Notifications Not watching Be notified only when participating or @mentioned. Watch Releases only Be notified of new releases, and when participating or @mentioned. Unwatch releases Watching Be notified of all conversations. Unwatch Ignoring Never be notified. Stop ignoring 1
  • Unstar 0 Star 0
  • Fork 0

Prof-Greipl/plutoscript Private

Code Issues 1 Pull requests 0 Projects 0 Security Insights Settings Code Issues 1 Pull requests 0 Projects 0 Security Permalink Tree: a999911612 Find file Copy path

plutoscript/c1_getting_started/4_development_notes.md

Find file Copy path Fetching contributors… Cannot retrieve contributors at this time 64 lines (39 sloc) 3.79 KB Raw Blame History

Development Notes

Guidelines and Hints for Coding

  • Manage imports: <CTRL>-<Shift>-o> must be used heavily to automatically create imports needed. In the settings you can further automatize the imports (File -> Settings -> Editor -> General -> Auto Import ->)
  • Pretty printing: CTRL-Alt>-l> reformats your code. Use it.
  • In your code use TODO as hint at placed, where work still has to be done. Review all TODOs in generated code.
  • Add line numbers: Add line numbers to the editor – it makes debugging easier. (Right-click in left bar of editor window.)
  • During lectures we occasionally will define string constants directly in layout files or -igitt - directly in the java code. This is not good practice, but speeds up development. Consider using the appropriate resource files in your development.
  • This document shows a lot of code fragments with the most important code lines only, i.e. with omissions, missing imports, missing package statements. Therefore use those fragments as a template only. Review and adapt to your code.
  • Consider using source code control and make regular updates of the projects.
  • Usually AS runs quite stable. Be aware the AS is periodically rebuilding your project automatically, if set so. If you have any problems, try the following:
    • Restart AS (seldom needed)
    • Clean Project and Rebuild Project (Build Menu)
  • You might consider the official Java Style Guide of Google or this Java Code Style Guide for Android.
  • Dark Mode: File->Settings-Appearance & Behavior->Behavior, then select "Darcula". This will change AS to dark mode.

Logging and Logcat

Logging is an important task in any application. The section will introduce you to logging. Please make sure to add log-messages at your own discretion. This document mentions only important log messages.

Logging

In most classes we will define a static variable TAG, to include the source in log messages.

private static final String TAG = "XX MyActivity";

Of course you can omit the XX in the TAG constant, but it makes filtering of our messages in logcat (see section below) very convenient.

We will use the class Log to include log-messages from the mobile app,e.g.

Log.d(TAG, "my log message“)

Read more about Logging.

Logcat

AS includes a logcat Monitor that displays debug messages, created with Log.d(...) calls.

The logcat Monitor displays system messages, such as when a garbage collection occurs, as well as messages that you can add to your app using the Log class. It displays messages in real time and also keeps a history so you can view older messages.

To display just the information of interest, you can create filters, modify how much information is displayed in messages, set priority levels, display messages produced by app code only, and search the log. By default, the logcat Monitor shows the log output related to the most recently run app only. (Source)

Further Reading on Logcat

To show logcat automatically check the corresponding entry in the Miscellaneous section of the Run Configuration

Git

You might use Git (proposed) or any other version control system. Googel will help you to install. See a screen shot with Git installed below.

Design

This is not a UI Design Course and our time is limited. You might have a look at Androids Material Design Style Guides. Go

results matching ""

    No results matching ""