WWW.DISSERTATION.XLIBX.INFO
FREE ELECTRONIC LIBRARY - Dissertations, online materials
 
<< HOME
CONTACTS



Pages:   || 2 | 3 | 4 | 5 |   ...   | 11 |

«2 Copyright © 2014 by Syncfusion Inc. 2501 Aerial Center Parkway Suite 200 Morrisville, NC 27560 USA All rights reserved. I mportant licensing ...»

-- [ Page 1 ] --

1

By

Ryan Hodson

Foreword by Daniel Jebaraj

2

Copyright © 2014 by Syncfusion Inc.

2501 Aerial Center Parkway

Suite 200

Morrisville, NC 27560

USA

All rights reserved.

I mportant licensing information. Please read.

This book is available for free download from www.syncfusion.com on completion of a registration form.

If you obtained this book from any other source, please register and download a free copy from

www.syncfusion.com.

This book is licensed for reading only if obtained from www.syncfusion.com.

This book is licensed strictly for personal or educational use.

Redistribution in any form is prohibited.

The authors and copyright holders provide absolutely no warranty for any information provided.

The authors and copyright holders shall not be liable for any claim, damages, or any other liability arising from, out of, or in connection with the information in this book.

Please do not use this book if the listed terms are unacceptable.

Use shall constitute acceptance of the terms listed.

SYNCFUSION, SUCCINCTLY, DELIVER INNOVATION WITH EASE, ESSENTIAL, and.NET ESSENTIALS are the registered trademarks of Syncfusion, Inc.

Technical Reviewer: Rui Machado Copy Editor: Courtney Wright Acquisitions Coordinator: Hillary Bowling, marketing coordinator, Syncfusion, Inc.

Proofreader: Morgan Cartier Weston, content producer, Syncfusion, Inc.

3 Table of Contents Contents The Story behind the Succinctly Series of Books

About the Author

Introduction

Chapter 1 Setting Up

The Android SDK

Installation

Creating a Project

Setting Up the Emulator

Compiling the Application

Chapter 2 Hello, Android

App Structure Overview

Creating a User Interface

Adding a Button

Defining String Resources

Detecting Button Input

4 Logging Output

Creating Another Activity

Linking Activities With An Intent

Another Button

Passing Data with Intents

Summary

Chapter 3 The Activity Lifecycle

Common Activity Transition Events

Pressing the Power Button

Rotating the Device

Tapping the Back Button

Recreating Destroyed Activities

Restoring Instance State

Saving Instance State

View States

Example Project

Summary

Chapter 4 User Interface Layouts

–  –  –

Loading Layouts

Basic View Attributes

Size

Padding

Margin

Common Layouts

Linear Layouts

Relative Layouts

List and Grid Layouts

Nesting Layouts

Summary

Chapter 5 User Interface Widgets

Images

Adding Drawable Resources

Scaling Images

Programmatically Defining the Image Source

Buttons

6 Text Fields

Styling Text Fields

Editable Text Fields

Checkboxes

Radio Buttons

Spinners

Date/Time Pickers

Summary

Chapter 6 Fragments

Creating a Fragment

Embedding Fragments in Activities

Swipe Views

Adding Tabs

Summary

Chapter 7 Application Data

Shared Preferences

Internal Storage

SQLite Databases

–  –  –

Accessing the Database

Inserting Rows

Querying the Database

Summary

–  –  –

Whenever platforms or tools are shipping out of Microsoft, which seems to be about every other week these days, we have to educate ourselves, quickly.

Information is plentiful but harder to digest In reality, this translates into a lot of book orders, blog searches, and Twitter scans.

While more information is becoming available on the Internet and more and more books are being published, even on topics that are relatively new, one aspect that continues to inhibit us is the inability to find concise technology overview books.

We are usually faced with two options: read several 500+ page books or scour the web for relevant blog posts and other articles. Just as everyone else who has a job to do and customers to serve, we find this quite frustrating.

The Succinctly series This frustration translated into a deep desire to produce a series of concise technical books that would be targeted at developers working on the Microsoft platform.

We firmly believe, given the background knowledge such developers have, that most topics can be translated into books that are between 50 and 100 pages.

This is exactly what we resolved to accomplish with the Succinctly series. Isn’t everything wonderful born out of a deep desire to change things for the better?

The best authors, the best content Each author was carefully chosen from a pool of talented experts who shared our vision. The book you now hold in your hands, and the others available in this series, are a result of the authors’ tireless work. You will find original content that is guaranteed to get you up and running in about the time it takes to drink a few cups of coffee.

9 Free forever Syncfusion will be working to produce books on several topics. The books will always be free.

Any updates we publish will also be free.





Free? What is the catch?

There is no catch here. Syncfusion has a vested interest in this effort.

As a component vendor, our unique claim has always been that we offer deeper and broader frameworks than anyone else on the market. Developer education greatly helps us market and sell against competing vendors who promise to “enable AJAX support with one click,” or “turn the moon to cheese!” Let us know what you think If you have any topics of interest, thoughts, or feedback, please feel free to send them to us at succinctly-series@syncfusion.com.

We sincerely hope you enjoy reading this book and that it helps you better understand the topic of study. Thank you for reading.

–  –  –

10 About the Author Ryan Hodson began learning ActionScript at age 14, which eventually led to a job creating Flash-based data visualizations for the National Center for Supercomputing Applications at the University of Illinois. Since then, he's worked in a diverse collection of programming fields, building everything from websites to e-publishing platforms, touch-screen thermostats, and natural language processing tools. These experiences have led to a love of exploring new software and a proficiency in several languages (HTML/CSS, JavaScript, PHP, MySQL, Python, Java, Objective-C, PDF) and many frameworks (WordPress, Django, CherryPy, and the iOS and OSX SDKs, to name a few).

In 2012, Ryan founded an independent publishing firm called RyPress and published his first book, Ry's Friendly Guide to Git. Since then, he has worked as a freelance technical writer for well-known software companies, including Syncfusion and Atlassian. Ryan continues to publish high-quality software tutorials via RyPress.com.

–  –  –

Android is the main alternative to the iOS platform for mobile applications, but unlike iOS, Android projects can easily be created using OS X, Windows, or Linux-based computers. And since Android uses the Java programming language, developers coming from a C# background will most likely feel more comfortable than they would with iOS’s Objective-C programming language.

The goal of Android Programming Succinctly is to guide you through the major aspects of Android development with friendly, concise examples. You should walk away with a solid understanding of the necessary design patterns, frameworks, and APIs for producing a polished Android app. If you would like to follow along with the sample code, it can be found here.

–  –  –

Before we start writing any code, our first task is to set up a development environment. The

major components necessary for building an Android app are as follows:

 A text editor for writing your code.

 The Android framework for linking against your application code.

 The Android command-line tools for compiling your code into a working app.

 An emulator or actual device for testing your compiled application.

While it’s possible to use virtually any IDE or text editor to create apps, the easiest way to get started with the Android platform is the official Android Software Development Kit (SDK), which contains all of these components in a single convenient download.

The Android SDK The Android SDK (available for OS X, Windows, and Linux) includes the Eclipse IDE with the Android Developer Tools (ADT) plugin, along with an emulator, a graphical layout editor, and some other useful features. This is also the development environment that we’ll be using in this book, so go ahead and download it now so you can follow along.

Installation After the download has completed, unzip the file and open the eclipse folder. It should contain an Eclipse executable that you can launch to start the IDE. You’ll be prompted to select a workspace folder, and then Eclipse should be ready to go. And that’s it for installation!

Creating a Project Let’s jump right in by creating a new Android project. On the File menu, click New. In the resulting wizard, select Android Application Project.

–  –  –

This will prompt you for some information about your new project:

 Application Name: The name of your app. Use Hello Android for this field.

 Project Name: The name of the project directory. This should be automatically populated with HelloAndroid, and you can leave this value as is.

 Package Name: The unique namespace for the project. Since it’s just an example app, you can leave the default com.example.helloandroid, but you should use the reverse domain name of your organization for real applications.

The remaining fields define important platform requirements, and you can leave them all at their

default values. Your configuration should look like the following when you’re done:

–  –  –

The next two windows ask you about some other miscellaneous details and the app’s icon. You can leave all of them at their default values. Finally, you’ll come to the following window asking if

you want to create an activity:

–  –  –

We’ll talk about activities in great detail next chapter, but all you need to know for now is that an activity represents a single screen of your application. We want to have something to look at initially, so make sure Create Activity is checked, then select Blank Activity to specify an empty screen. In the next window, you can use the default MainActivity and activity_main values for the Activity Name and Layout Name fields (again, we’ll discuss layouts in the next chapter). Click Finish to create a brand new Eclipse project.

Setting Up the Emulator Unfortunately, we can’t immediately compile the template project to see what it does. First, we need to set up a device on which to test our new app. Android is designed to let you run a single application on devices of wildly differing dimensions and capabilities, making it a very efficient platform for porting apps from smartphones to tablets to anything in between. The Android Virtual Device Manager included in the SDK allows you to emulate virtually any device on the market.

16 To view the list of emulated devices, navigate to Window and select Android Virtual Device Manager. This window makes it easy to see how your application behaves on all sorts of Android devices, test different screen resolutions and dimensions, and experiment with various device capabilities (e.g., hardware keyboards, cameras, storage capacity).

To create an emulated device for our project, click New... and use GalaxyNexus for the AVD Name, then select Galaxy Nexus from the Device dropdown menu, and leave everything else as the default. For development purposes, it’s also a good idea to check the Use Host GPU to use your computer’s GPU, since emulating animations can be quite slow and clunky. Your

configuration should resemble the following:

–  –  –

The emulator has to boot up the Android operating system (just like a real device), so you might be staring at that Android logo for a while before the emulator is actually ready to use. When it is finally ready, you’ll see the typical Android home screen, and you can click around to launch

apps and explore the emulated device:

–  –  –

18 Since it takes so long to boot, you’ll want to keep the emulator running as you start writing code (Eclipse can re-launch the application on the emulator without restarting it).

Compiling the Application We’re finally prepared to compile the sample project. Back in Eclipse, make sure one of the source files is selected in the Package Explorer, then click Run, select Run as, and choose Android Application. After taking a moment to compile, you should see your first Android app in the device emulator. As you can see, the default template contains a single text field that says “Hello world!”

–  –  –

In the next chapter, we’ll learn how to change the contents of this text field, add other UI components, and organize a simple Android application.

–  –  –

In this chapter, we’ll discover the fundamental design patterns of all Android applications. We’ll learn how to work with activities, display UI elements by editing XML layout files, handle button clicks, and switch between activities using intent objects. We’ll also learn about best practices for representing dimension and string values for maximum portability.

Each screen in an Android app is represented by a custom subclass of Activity. The subclass defines the behavior of the activity, and it’s also responsible for loading user interface from an XML layout file. Typically, this XML layout file is where the entire interface for a given activity is defined. To display text fields, buttons, images, and other widgets to the user, all you need to do is add XML elements to the layout file.



Pages:   || 2 | 3 | 4 | 5 |   ...   | 11 |


Similar works:

«AIMMS Function Reference File Suffices This file contains only one chapter of the book. For a free download of the complete book in pdf format, please visit www.aimms.com Aimms 3.13 File Suffices Aimms files support the following three collections of suffixes. File suffix group 1: the suffixes that apply to the entire file..Ap.blankzeros.case.PageNumber.PageMode.PageSize.PageWidth File suffix group 2: the suffixes that control page layout..TopMargin.LeftMargin.BottomMargin...»

«HACKER (Forthcoming, The Johns Hopkins Encyclopedia of Digital Textuality, 2014) E. Gabriella Coleman Hackers. They seem to be everywhere, landing headlines in the news, founding companies in Silicon Valley and hacker spaces around the world, and at times, facing years in jail. Despite this presence, they are everywhere misunderstood. Generally, a hacker is a technologist with a penchant for computing and a hack is a clever technical solution arrived at through non-obvious means (Levy 1984,...»

«John Protevi Department of French Studies www.protevi.com/john/DG protevi@lsu.edu Class notes: not for citation in any publication! I'd like to express my gratitude to Dan Smith of Purdue University, for letting me see his superb lecture notes on Difference and Repetition, to which these lectures are greatly indebted. Spring 2007: The Major Works of Gilles Deleuze Fourth day lecture: 12 February 2007: Chapter 3 of DR 3 main parts of Chapter 3:1. the first four postulates 2. the differential...»

«Sermon #2143 Metropolitan Tabernacle Pulpit 1 THE SHINING OF THE FACE OF MOSES NO. 2143 A SERMON DELIVERED ON LORD’S-DAY, MAY 18, 1890, BY C. H. SPURGEON, AT THE METROPOLITAN TABERNACLE, NEWINGTON. INTENDED FOR READING ON LORD’S-DAY MORNING, MAY 4, 1890. “And it came to pass when Moses came down from mount Sinai with the two tables of testimony in Moses’ hand, when he came down from the mount, that Moses knew not that the skin of his face shone while he talked with Him. And when Aaron...»

«NAVAL POSTGRADUATE SCHOOL MONTEREY, CALIFORNIA DISSERTATION GENERATING ENHANCED NATURAL ENVIRONMENTS AND TERRAIN FOR INTERACTIVE COMBAT SIMULATIONS (GENETICS) by William David Wells September 2005 Dissertation Supervisor: Rudolph Darken Approved for public release; distribution is unlimited THIS PAGE INTENTIONALLY LEFT BLANK REPORT DOCUMENTATION PAGE Form Approved OMB No. 0704-0188 Public reporting burden for this collection of information is estimated to average 1 hour per response, including...»

«Anlage 1 RCM Beteiligungs Aktiengesellschaft, Sindelfingen Konzernbilanz zum 31. Dezember 2015 AKTIVA PASSIVA 31.12.2015 31.12.2014 31.12.2015 31.12.2014 € € € € € € A. Anlagevermögen A. Eigenkapital I. Immaterielle Vermögensgegenstände I. Gezeichnetes Kapital 1. entgeltlich erworbene Konzessionen, gewerbliche 1. Gezeichnetes Kapital 14.700.000,00 13.370.000,00 Schutzrechte und ähnliche Rechte und W erte 2. abzgl. Eigene Anteile -46.082,00 -16.020,00 sowie Lizenzen an solchen...»

«Forthcoming: Rationality and Society Portrait of a Failed Rebellion: An Account of Rational, Sub-optimal Violence in Western Uganda By LUCY HOVIL AND ERIC WERKER* Abstract While newspaper reports typically describe anti-civilian violence in civil war as resulting from hatred or anarchy, there is an emerging literature that interprets these processes as calculated, strategic actions of war makers. We argue that this literature overestimates the strategic value of violence by focusing on...»

«Dep’t of Parks & Recreation v. Mullusky OATH Index No. 2041/09 (May 26, 2009) Parks worker charged with participating in a Nazi skit in front of a Jewish co-worker, remarking that he would throw the co-worker and his mother into an oven, displaying swastikas on his locker, and making false statements. ALJ found that the charges should be sustained. Penalty of termination recommended. NEW YORK CITY OFFICE OF ADMINISTRATIVE TRIALS AND HEARINGS In the Matter of DEPARTMENT OF PARKS AND...»

«1 CHAPTER BACKGROUND TO THE LANGUAGE, COMMUNITY, AND FIELDWORK 1.1 Introduction The present work is a grammatical description of the Mukri variety of Central Kurdish accompanied by a collection of texts and a brief lexicon. More theoretical aspects of person marking and argument indexation patterns in Central Kurdish are presented in a companion volume currently being prepared for publication (Öpengin forthc.). Central Kurdish, more widely known as Sorani, is one of the major varieties of...»

«Reluctant Meister How Germany's past is shaping its European future By Lord Stephen Green, Member of the House of Lords It is a great honour for me to stand here today, amongst friends from former times when I was a banker in a competing house, as well as other friends from my time as Trade and Investment Minister of the British Government. Both roles brought me often to Germany a country I have loved and found fascinating ever since my schooldays. To start with, it was the German language...»

«MATERIAL SAFETY DATA SHEET, revised 8 July 2011, printed 8 July 2011 Page 1 of 6 T-300 – PVC Adhesive Thinner 1. PRODUCT AND COMPANY INFORMATION Trade name PVC Adhesive Thinner Product codes ZGT-300, T-300 Chemical family Solvent mixture Intended use Thinner for PVC Adhesives Company Colorado Paint (a Swarco Company) 4747 Holly Street Denver, CO 80216; U. S. A. Telephone +1 303-388-9265 Web site www.swarco.com/americas Emergency (Chemtrec; 24 h) 1-800-424-9300 (U. S. A. and Canada) 2. HAZARD...»

«Effectiveness of Contemporary Public-Private Partnerships for Large Scale Infrastructure Projects in the United States Doran J. Bosso Thesis submitted to the Faculty of the Virginia Polytechnic Institute and State University in partial fulfillment of the requirements for the degree of Master of Science In Civil Engineering Michael J. Garvin, Chair Anthony D. Songer Christine M. Fiori April 18, 2008 Blacksburg, Virginia Keywords: Public-Private Partnership, Innovative Project Delivery,...»





 
<<  HOME   |    CONTACTS
2016 www.dissertation.xlibx.info - Dissertations, online materials

Materials of this site are available for review, all rights belong to their respective owners.
If you do not agree with the fact that your material is placed on this site, please, email us, we will within 1-2 business days delete him.