You are on page 1of 10

Progress Report

Kristoffer Rosn October 2, 2012

Previous meeting

Introduced SDF and Stratego Gave some simple examples of grammar definition and code generation using the above

Since last meeting

Created two of the same very simple applications for Android and iOS

Purpose: Get a feel of what language constructs are needed in the DSL to be able to create some basic apps Some findings:

Smartphone apps are usually centered around the user interface, and navigation between screens Central classes are Activity (Android); UIApplicationDelegate, UIViewController (iOS)

Activity (1)

An activity is a single, focused thing that the user can do

Usually, this corresponds to a full screen window that is shown to the user

public class MainActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); }

Activity (2)

Changing between Activities (screens)


public void showDetailInfo(View v) { Intent intent = new Intent(v.getContext(), DetailActivity.class); this.startActivityForResult(intent, 0); }

For example, showDetailInfo might be declared as an onClick property for a button in the XML layout file

Activity (3)

Often necessary to pass data between Activities


public void showDetailInfo(View v) { Intent intent = new Intent(v.getContext(), DetailActivity.class); intent.putExtra(IDENTIFIER_STRING, someData); this.startActivityForResult(intent, 0); }

UIViewController (1)

An instance of this class handles a UIView object, which can be thought of as the screen
@implementation MyViewController

- (void)loadView { CGRect bounds = [[UIScreen mainScreen] bounds]; self.view = [[UIView alloc] initWithFrame: bounds]; }

@end

UIViewController (2)

Changing between views can be done by UINavigationController


Handles UIViewController objects Acts like a stack

pushViewController popViewController

UIApplicationDelegate

Entry point of the application (cf. In Java it is an Activity, defined in a manifest file) application:didFinishLaunching

Initiate view controllers, and add them to the UINavigationController


self.navController = [[UINavigationController alloc] init]; UIViewController *vc = [[MyViewController alloc] init]; [self.navController pushViewController:vc]; self.window.rootViewController = self.navController;

Until next meeting


Start defining grammar for user interface Define a little bit of grammar implement the code generation for both Android and iOS

UI will be difficult to generate code for want to start early Layout predefined, possibility to set exact position values for UI components?

Things to think about

You might also like