Thursday, January 23, 2014

How to Make Pages on the Android



1. Open the Eclipse software and load the Android project. In the left panel, all of the Android's folders, Java classes and XML files are displayed. Double-click 'res,' then double-click 'layout.'

2. Right-click the 'layout' folder, click 'Add,' then click 'New Android XML File.' Type a name for the file and select a type of screen in the list of resources. Click 'Finish' to create the file and the page for the app. Eclipse automatically opens the file in the designer.

3. Drag and drop each Android button, menu item and image you want to display in the new Android page. After you finish adding the visual elements, double-click the Java class file you want to use to load the screen.

4. Add the following code to the Java file:setContentView(R.layout.test);Replace 'test' with the name of the file you created in step two. This code loads the screen on the Android device.

5. Click the 'Save' button, then click 'Run' to load the new page in the Android emulator. The emulator compiles the code and displays the page in a window that looks like a cellphone or tablet.

No comments:

Post a Comment