Free Essay

Android App Dev

In:

Submitted By saadahmed99
Words 997
Pages 4
Name: ______________________________

CSSE483 Android Application Development

Lab 1: Getting Started with Buttons
The purpose of this lab is to give you some practice building simple Android apps.

______ Part A: Building a Simple User Interface ______ Part B: Linear Lights Out

A. Building a Simple User Interface 1. Create a new Application called MyFirstAppYourName. You can use your username or initials as long as they are unique among your classmates.) Setup the UI for the MainActivity using the link below. Note that the link is to a single step in a Google tutorial. Only do that one step. You do not need to do the “Starting Another Activity” step that comes next. So only this one page. http://developer.android.com/training/basics/firstapp/building-ui.html Complete that page then use the instructions below. 2. So far so good, but the button doesn’t do anything. Add java code to listen for the button press. If it is pressed, it checks to see what the user entered. If they entered “secret”, the button’s text will change to “Wow”. Otherwise, it stays, “Send” like in the tutorial. Hint: The body of the onClick method will include this: if (editText.getText().toString().equals(getString(R.string.secret))) { button.setText(R.string.button_text_wow); } else { // you fill this in } Notes: (1) Check out the return type for the getText() method. Can you see why you need the toString()? (2) Note that the setText() method can take a resource

ID (a string from strings.xml) as a parameter. (3) I even made “secret” a string in strings.xml. Putting all your strings in strings.xml is good practice that you should follow. Note: When you copy/paste the code, you’ll need to press Ctrl-Shift-O to import the necessary packages. Sometimes you’ll need to select the Android version of the package (usually the top option). For the edit box area make sure you import the android.view.View.OnKeyListener not the android.content.DialogInterface.OnKeyListener. Your final app should look like this:

To get credit for this part of the lab you will need to show your emulator (or device) running this app to an instructor.

B. Linear Lights Out
App name: LightsOutYourName. The purpose of this app is to learn about creating a view using an XML layout file then connecting it to a model object. The game you will be developing is called Lights Out. The goal of Lights Out is usually to click lights and eventually turn them all off, hence the name “Lights Out”. When a user clicks a light it toggles the state of the light that was clicked and toggles the state of all neighbor lights. Instead of lights we’ll just use 0 and a 1 and try to make all the buttons match. In our version we will have a line of exactly seven buttons arranged in a line. We fix the number to keep it simple; in a future version, we will make the number of buttons variable.

Note that clicking on the first or last button in the line toggles only two buttons. Clicking any other button will toggle three buttons. The button row and text should be centered. The text size should be 20 sp. The new game button should be right-aligned with the buttons. You can choose reasonable margins: To help you out you can download the model object called LightsOutGame.java (or

you can make it yourself). Model object backing class:

LightsOutGame.java

There are really only three functions you need to use from that class: public LightsOutGame(int numButtons); public boolean pressedButtonAtIndex(int buttonIndex); public int getValueAtIndex(int buttonIndex); Here is the javadoc if you prefer: LightsOutGame Javadoc These should be pretty straightforward. The boolean value returned from pressedButtonAtIndex determines if the game was won with that click. If the game was won then you should change the text to say “You Win!” (or something like that). If the game was not won with that click display “Make the buttons match” (or something like that). Note, you may need to change the package name for that file when you add it to your project to make it match your package name. One note: at first my buttons were too wide to show all seven in portrait mode. If you view a Button in the Properties view, it has a minWidth ­ mine was 64dp. (Interestingly, it doesn’t show up in the layout.xml, but in values > dimens.xml). Changing these to 32dp fixed it for me. With only 7 buttons it should be fairly easy to make the layout look good on most emulator screen sizes in landscape or portrait (rotate emulator using ctrl­F12). Make the background color anything other than black.

Note: It is okay to NOT save state between launches and rotations. We will cover saving state in a future unit.

As a final step disable all the game buttons when a player wins. Then re­enable them when a new game starts. When the buttons are disabled they can’t be clicked and they will gray out slightly. (Hint: I expect you to search the javadoc for buttons to find the method to do this.) Note that the “New Game” button should always be enabled.

When you finish this project show your instructor! You finished Lab 1. Submission Note: If you are taking this course online, to show your instructor, you should capture a video of you launching the app on your phone or emulator, and then playing the game until you win, resetting the game using the new game button to show that it randomizes again, and then winning the game a second time. Hold the phone nice and close to the camera so I can see it. And please explain what you are doing as you go loudly and clearly ­ since I don’t get to see you face­face, I especially want to hear your voice! :) Submit the video along with your zipped Eclipse project.

Similar Documents

Free Essay

Management

...1. ABSTRACT About Fetchme * A Fetchme Application is Simple user friendly App that allows students to access the information about the availability of books Through this simple App using smart phones. * Can Browse over the digital library to access the digital books and can download. * Fetchme App makes use of wi-fi network to access the library database. Aim: * The purpose of project is to provide a user friendly interface App for android smart phones. So that students at any point of time can easily operate the App to fetch the information about the book. * From library database the client can view the complete details of his transaction of books like borrowing books,renewal, return date also can get support through the mails. Intended Users: * Administrator. * End users. Software Requirements: * Front End: XML,HTML5 * Middle ware: JavaScript. * Back End: MYSQL. * Operating System: Android * The latest Testflight Android SDK * ADT (Android Developer Tools). Hardware Requirements: * Smart Phone with Android Operating System. Android: * An Android project is the container for your application's source code, resource files, and files such as the Ant build and Android Manifest file. An application project is the main type of project and the contents are eventually built into an .apk file that you install on a device. Hyper Text Markup Language (HTML): HTML is a language made for creating the web pages...

Words: 969 - Pages: 4

Free Essay

Bull Shit

...Mobile Emulation Remote Debugging on Android Saving Changes with Workspaces Performance & Profiling Reference Contents Requirements Setting up your Android device Discovering devices in Chrome Debugging remote browser tabs Debugging WebViews Live screencasting Port forwarding Virtual host mapping Troubleshooting Additional information Remote Debugging on Android with Chrome The way your web content behaves on mobile can be dramatically different from the desktop experience. Remote debugging with Chrome DevTools lets you debug live content on your Android device from your development machine. Debugging Chrome for Android using the Chrome Developer Tools Remote debugging on Android supports: Debugging websites in browser tabs. Debugging WebViews in native Android apps. Screencasting live to your development machine from your Android device. Accessing your development server on Android using port forwarding and virtual host mapping. Requirements To begin remote debugging, you need: Chrome 32 or later installed on your development machine. A USB cable to connect your Android device. For browser debugging: Android 4.0+ and Chrome for Android. For app debugging: Android 4.4+ and a WebView configured for debugging. Note: Remote debugging requires your version of desktop Chrome to be newer than the version of Chrome for Android on your device. For best results, use Chrome Canary (Mac/Windows) or the Chrome Dev channel release (Linux) on desktop. ...

Words: 2425 - Pages: 10

Free Essay

Student

...Service Design Based on Android Xianhua Shu, Zhenjun Du, Rong Chen School of Information Science and Technology Dalian Maritime University Dalian, China xiansimba@163.com Abstract—Android platform is a new generation of smart mobile phone platform launched by Google. Android provides the support of mobile map and location service, which is probably a concern of vast numbers of developers. So far, the development of mobile map and location applications is complex and difficult, and is often required to pay high copyright fees to map makers. Android is free and open, providing an easy-to-use development kit containing flexible map display and control functions. This paper introduces the architecture and component models of Android, and analyzes the anatomy of an Android application including the functions of Activity, Intent Receiver, Service, Content Provider, and etc. Based on Android, the design method of a location-based mobile service is then presented. The design example shows that it’s so easy to implement self-location, to draw the driving trace, to perform query and to flexibly control the real-time map on Android. Keywords-Android; location based service; driving trace enable developers to form their mobile systems with unique characteristics. The architecture of Android framework and the anatomy of an Android application are addressed in section II and section III. Based on the analyses, the design of a location-based mobile service on Android is then presented in...

Words: 2601 - Pages: 11

Free Essay

Mobile Applications Market

...The mobile apps market is very elastic and continues to expand each and every day. The mobile market has a wide variety of applications that no matter what type of interests you may have, there is something for you. Outlined further in this report will outline the demand for these apps, trend analysis, current market status, success stories and lastly the end users. It was in June of 2008 when Apple Inc released its 3G Apple Iphone which featured support for third party applications. Then only a short month later the Apple app store was created. This took consumers by storm and in the first weekend over 10 million apps were downloaded. Since its release the app store has continued to expand with more apps and better quality apps that now range from E-books to a very humorous fart app. Shortly after Apple had seen rapid success with its app store, other leading Telephone providers like blackberry, Nokia and Android soon released a similar app store for their users. The evolution of mobile apps seems to be creating applications in which ease day to day living through our smart phones. For example in the Apple app store, there are apps which allow you to receive newspapers like the New York Times, or the Globe and Mail directly to your mobile device. There are also apps which act as a PDF creator, it allows for the consumer to take pictures of multiple documents, upload them all as one PDF and then have the ability to send it as an email. There are many more apps which will benefit...

Words: 1635 - Pages: 7

Free Essay

Updating Android Operating System

...Updating Android operating system, is it really safe? All Android devices at risk of being hacked when installing OS system updates _ Pileup Flaws By Raunak Chatterjee and Anisha Agarwal Student of Computer Science and Engineering department of Calcutta Institute of Technology Email: rnk.chatterjee.cit@gmail.com ------------------------------------------------- Anishaagarwal1992@gmail.com Abstract: Android is a Linux based operating system. Initially developed by Android, Inc., which Google backed financially and later bought in 2005, Android was unveiled in 2007 along with the founding of the Open Handset Alliance—a consortium of hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices. The first publicly available smartphone running Android, the HTC Dream, was released on October 22, 2008. Android's source code is released by Google under the Apache License; this permissive licensing allows the software to be freely modified and distributed by device manufacturers, wireless carriers and enthusiast developers. As of July 2013, Android has the largest number of applications, available for download in Google Play store which has had over 1 million apps published, and over 50 billion downloads. A developer survey conducted in April–May 2013 found that Android is the most used platform among developers: it is used by 71% of the mobile developers’ population. From astro 1.0 to kit Kat android make itself evolved. For evolving...

Words: 4974 - Pages: 20

Premium Essay

Computers

...will need to use. They have ecommerce sites, mobile apps, rich media sites, test/dev environments, sharepoint developments, saas applications, corporate websites, and enterprise applications. You can access linux and windows servers, my SQL cloud databases with 229% faster performance than RDS, high performance ssd block storage and cloud files storage with cdn, and software defined networks. You have the option of building your own language; it is open to any API depending on what language you prefer whether it is Java, Python etc. They also have Rackspace private cloud and hybrid cloud that you can try. Amazon has many of the same features you can choose from. They have a lot of high memory space like extra large instance is 17.1GB, double extra memory is 34.2GB, and quadruple extra large is 68.4 GB. It can be used on many different operating systems such as red hat, suse linux, fedora, windows server, amazon linux, Gentoo linux, oracle, Ubuntu, and debian. The cost depends on exactly how much you use and they charge by the hour with no long term commitments. It is reliable, secure, inexpensive, and easy to start. With the google cloud they have a lot of security features to make sure your work is safe. Your work is always backed up, you can control your own data, increased security and reliability, strong encryption and authentication, and they are constantly improving your security. You can stay connected with your android, iphone, blackberry, windows phone, and on any phone...

Words: 366 - Pages: 2

Premium Essay

Internation Marketing

...De Montfort University City University of Hong Kong BA (HONS) BUSINESS ADMINISTRATIONS AND MANAGEMENT (121-29080) Corporate Strategy (Module code: BAMG 3108) Assignment Topic: Group Report Submit on: 20 November 2012 Name of Instructor: Mr. Eric Lam Name of Student (DMU Student No): (1) Kong Kwok Shing (DMU) P11013981 (SCOPE) 52810589 (2) Lai Ka Yi (DMU) P11014709 (SCOPE) 52810450 (3) Ng Yiu Ping (DMU) P11013811 (SCOPE) 52810332 (4) Wong Shu Kei (DMU) P110247X (SCOPE) 52810553 Table of Contents Page 1. Introduction 3 2. Macro-Environmental Analysis 4-7 3. Mobile Phone Industry Analysis 7-10 4. Critical Success Factors 10-13 5. Scenario Planning 13 6. Reference 14-15 7. Appendix 16-18 1. Introduction Nokia, one of the international communication and information technology company in the world which found in Finland. Their main products are phone and portable IT equipment. It also provides Internet services, including applications, games, music, media and communications through its Ovi platform, and free digital map information. Nokia is the largest vendor of mobile in the world since 1998 to 2008. However, in this past 5 years, Nokia has suffered declining market share because...

Words: 4138 - Pages: 17

Premium Essay

Smartphones Operating Systems

...to function. Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources. For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and will frequently make a system call to an OS function or be interrupted by it. Operating systems can be found on almost any device that contains a computer—from cellular phones and video game consoles to supercomputers and web servers. Examples of popular modern operating systems include Android, BSD, iOS, Linux, OS X, QNX, Microsoft Windows, Windows Phone, and IBM z/OS. All these, except Windows, Windows Phone and z/OS, share roots in UNIX. Smartphone A Smartphone, or smart phone, is a mobile phone built on a mobile operating system, with more advanced computing capability and connectivity than a feature phone. The first smartphones combined the functions of a personal digital assistant (PDA), including email functionality, with a mobile phone. Later models added the functionality of portable media players, low-end compact digital cameras, pocket video cameras, and GPS navigation units to form one multi-use device. Many modern smartphones also include high-resolution touchscreens and web browsers that display standard web...

Words: 15551 - Pages: 63

Premium Essay

Globalization at Sap

...Globalization @ SAP Globalization Drives Business SAP Globalization Services Erik Törnqvist, LPM for ERP Financials, Sweden Agenda 1 2 3 4 Globalization @ SAP and Globalization Services Globalization Strategy Internationalization Localization 5 6 7 © Translation Service Offerings Highlights / Case Studies 2012 SAP AG. All rights reserved. 2 Agenda 1 2 3 4 Globalization @ SAP and Globalization Services Globalization Strategy Internationalization Localization 5 6 7 © Translation Service Offerings Highlights / Case Studies 2012 SAP AG. All rights reserved. 3 Business Trends That Foster SAP’s Value Proposition 1 Customers don’t want a product, they want to get a job done. 2 Growing speed and scope of global change. SAP offers the best solution portfolio to leverage these trends. With SAP, companies are ready for: Innovation at the speed of each business Transformation from built-to-last enterprises to built-to-adapt business networks Performance optimization closed loop from strategy to execution and back again The challenges of a globalized economy © 2012 SAP AG. All rights reserved. 4 Globalization @ SAP Facts and Figures Globalization is a key differentiator for SAP in a competitive market     Global customer base in >140 countries > 60 country version covering legal requirements delivered 39 languages delivered for various solutions ~ 1100 persons are working on globalization topics Strong commitment to customers ...

Words: 3162 - Pages: 13

Free Essay

Khan

...Android ™ A Programmer’s Guide This page intentionally left blank Android ™ A Programmer’s Guide J.F. DiMarzio New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul Singapore Sydney Toronto Copyright © 2008 by The McGraw-Hill Companies. All rights reserved. Manufactured in the United States of America. Except as permitted under the United States Copyright Act of 1976, no part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher. 0-07-159989-4 The material in this eBook also appears in the print version of this title: 0-07-159988-6. All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps. McGraw-Hill eBooks are available at special quantity discounts to use as premiums and sales promotions, or for use in corporate training programs. For more information, please contact George Hoare, Special Sales, at george_hoare@mcgraw-hill.com or (212) 904-4069. TERMS OF USE This is a copyrighted work and The McGraw-Hill Companies, Inc. (“McGraw-Hill”) and its licensors reserve all rights in and...

Words: 43266 - Pages: 174

Free Essay

Paper

...Full Circle THE INDEPENDENT MAGAZINE FOR THE UBUNTU LINUX COMMUNITY ISSUE #90 - October 201 4 Photo: miss_millions (Flickr.com) P R I S O N AR C H I T E C T BUILD YOUR OWN OPEN SOURCE PRISON Fu ll Ci rcle M a g a zi n e i s n e i th e r a ffi li a te d wi th , n o r e n d o rse d b y, Ca n o n i ca l Ltd . full circle magazine #90 1 contents ^ HowTo OpenConnect to Cisco p.1 4 Full Circle THE INDEPENDENT MAGAZINE FOR THE UBUNTU LINUX COMMUNITY Linux News p.04 BACK NEXT MONTH LibreOffice p.1 5 Command & Conquer p.1 2 Arduino p.25 LinuxLabs p.XX Broadcast With WCS p.1 7 Linux Labs p.28 Review p.36 My Story p.37 BACK NEXT MONTH Blender p.XX Letters p.40 Tuxidermy p.41 Q&A p.42 BACK NEXT MONTH Inkscape BACK NEXT MONTH Ubuntu Women p.XX Ubuntu Games p.44 Graphics p.22 Security p.XX The articles contained in this magazine are released under the Creative Commons Attribution-Share Alike 3.0 Unported license. This means you can adapt, copy, distribute and transmit the articles but only under the following conditions: you must attribute the work to the original author in some way (at least a name, email or URL) and to this magazine by name ('Full Circle Magazine') and the URL www.fullcirclemagazine.org (but not attribute the article(s) in any way that suggests that they endorse you or your use of the work). If you alter, transform, or build upon this work, you must distribute the resulting work under...

Words: 22047 - Pages: 89

Free Essay

Kali Always and Forever

...Official Kali Linux Documentation This PDF has been autogenerated on docs.kali.org - Aug 19, 2013 00. Introduction to Kali Linux What is Kali Linux ? Kali Linux is an advanced Penetration Testing and Security Auditing Linux distribution. Kali Linux Features Kali is a complete re-build of BackTrack Linux, adhering completely to Debian development standards. All-new infrastructure has been put in place, all tools were reviewed and packaged, and we use Git for our VCS. More than 300 penetration testing tools: After reviewing every tool that was included in BackTrack, we eliminated a great number of tools that either did not work or had other tools available that provided similar functionality. Free and always will be: Kali Linux, like its predecessor, is completely free and always will be. You will never, ever have to pay for Kali Linux. Open source Git tree: We are huge proponents of open source software and our development tree is available for all to see and all sources are available for those who wish to tweak and rebuild packages. FHS compliant: Kali has been developed to adhere to the Filesystem Hierarchy Standard, allowing all Linux users to easily locate binaries, support files, libraries, etc. Vast wireless device support: We have built Kali Linux to support as many wireless devices as we possibly can, allowing it to run properly on a wide variety of hardware and making it compatible with numerous USB and other wireless devices. Custom kernel patched for injection:...

Words: 26373 - Pages: 106

Free Essay

Blah

...NOS 120 Journal Ubuntu 10.04 This document is a periodical listing of all assignments and instructions completed in the NOS 120 class. 2011 NOS 120 Journal Ubuntu 10.04 This document is a periodical listing of all assignments and instructions completed in the NOS 120 class. 2011 ------------------------------------------------- Table of Contents: Table of Contents ………………………………………………………………………………………………………………………………… 2 Table of Contents (cont.) …………………………………………………………………………………………………………………….. 3 Course Syllabus ……………………………………………………………………………………………………………………………………. 4 Journal Post (8/17) ……………………………………………………………………………………………………………………………… 13 Chapter 1 Questions …………………………………………………………………………………………………………………………… 14 Journal Post (8/24) ……………………………………………………………………………………………………………………………… 16 Chapter 2 Questions ……………………………………………………………………………………………………………………………. 17 Journal Post (9/7) ………………………………………………………………………………………………………………………………… 18 Chapter 3 Questions ……………………………………………………………………………………………………………………………. 19 Journal Post (9/12) ……………………………………………………………………………………………………………………………… 20 Chapter 4 Questions …………………………………………………………………………………………………………………………… 21 Chapter 5 Questions …………………………………………………………………………………………………………………………… 23 NOS 120 Test 2 …………………………………………………………………………………………………………………………………… 24 Linux File System vs. Windows File System …………………………………………………………………………………………. 27 Journal Post (9/14) ……………………………………………………………………………………………………………………………… 28 10.04 Sources List ………………………………………………………………………………………………………………………………...

Words: 17866 - Pages: 72

Free Essay

Taking Leadership in the Digital Economy

...TAKING LEADERSHIP IN A DIGITAL ECONOMY BY TELSTRA CORPORATION LIMITED AND DELOITTE DIGITAL November 2012 deloittedigital.com.au telstra.com A NOTE FROM DAVID Consumers and businesses are rapidly embracing digital technology and this is redefining the traditional transaction model. We now have a new generation of globally connected consumers and businesses who behave very differently – and we must all adapt to these changes and take advantage of the new opportunities. By the end of the decade we will have connected just about every device to next generation networks, from smartphones and offices of the future, to educational resources and digital home appliances. The changes we are talking about are transformational. Everything, everyone and every place will be connected. This will make us more innovative and more competitive – and change the way we live and work for the better. The challenge ahead is how to best use the tremendous creativity, innovation and capability of Australians to participate in these new opportunities – whether it be m-commerce, Big Data, robotics or social media. Every part of our economy can benefit from this new era of connectivity. Our role, as Australian business leaders, is to help build a 21st century economy that is locally accessible and globally competitive. As a nation, we can lead the world and create positive change. David Thodey Chief Executive Officer Telstra 1 A NOTE FROM GIAM The world is changing. The internet has...

Words: 8332 - Pages: 34

Free Essay

Hacking

...By : Anurag Dwivedi [[Lets Hack The Universe]] Note: Only For Eductional Propose…xD xD !! Legal Disclaimer Any proceedings and or activities related to the material contained within this volume are exclusively your liability. The misuse and mistreat of the information in this book can consequence in unlawful charges brought against the persons in question. The authors and review analyzers will not be held responsible in the event any unlawful charges brought against any individuals by misusing the information in this book to break the law. This book contains material and resources that can be potentially destructive or dangerous. If you do not fully comprehend something on this book, don‘t study this book. Please refer to the laws and acts of your state/region/ province/zone/territory or country before accessing, using, or in any other way utilizing these resources. These materials and resources are for educational and research purposes only. Do not attempt to violate the law with anything enclosed here within. If this is your intention, then leave now. Neither writer of this book, review analyzers, the publisher, nor anyone else affiliated in any way, is going to admit any responsibility for your proceedings, actions or trials. About The Author Anurag Dwivedi is a 13 year old computer geek. Who likes to find vulnerabilities Doing Hacking , Programming , editing , cracking , web designing and writing books He Wants To Be An Software Designer..!!!! Join His Blog: Computer...

Words: 20358 - Pages: 82