Thursday, October 6, 2011

Android Programming - Luas Bangun

I created (actually it based on someone tutorial and I modified it in some place, I can find the original link..) this very simple program to learn more about User Interface. How to layout, using Button, TextView and Edit Text. It is so simple, the function is to calculate the area of square, traingle and circle. User input the width, height or radius, and then the app calculate the area and show the result in a TextView.
Check out the source code in my GitHub. Here is the link.
1. As ussual create new project, I named it Luas Bangun, with LuasBangunActivity as a main activity.
2. Prepare AndroidManifest, create 3 new Activity from there, named it HitungLingkaran (for circle), HitungSegitiga (for triangle) and HitungPersegiPanjang (for square).
3. Let's begin templating. First create layout for LuasBangunActivity. It is in the main.xml file. You need to create three other XML file, one for each, lingkaran.xml (circle area), persegipanjang.xml (square area) and segitiga.xml (triangle area).
4. And then code the MainActivity. It is used for main screen, giving a link to another activity and exiting from application.
5. The lingkaran, persegipanjang and segitiga do not have any difference in programming structure, it is same, the difference is just the algorithm to calculate the area, and I think it will be easy, you know it from since elementary school.
6. Run your application, hope you found no error and I hope this example will help you a little to understand basic of User Interface in Android.





Categories: , , , ,

Android Programming - Free Ebook (2)

1. Apress Android Essential - Chris Haseman

Android is Google’s answer to the iPhone and at the very least, has advantages in terms of multitasking, running apps in the background and others. Google’s CEO is getting front page coverage commenting on the coming Google/iPhone war.
This is a no frills, no nonsense, code centric run through the guts of application development on Google’s Mobile OS. It focuses on giving developers the essential tools and examples required to make viable commercial applications work.

Download | here |.

2. Apress Beginning Android - Mark L Murphy

Beginning Android, one of the first beginning books on Android, covers what the reader needs and wants to know to get started on programming Android applications — everything from crafting GUIs to using GPS and accessing Web services, and more.
Written by Android columnist, writer, developer and community advocate, Mark L Murphy, the easy-to-read style of Beginning Android makes entry-level Android development even more accessible.
Google’s open source Java-based Android mobile (and possibly Netbook applications) operating and development platform is growing with the availability of more and more Smart Phone devices that can utilize it. Beyond HTC G1 and G2 Google Phones, Android continues to grow and be in use as well as adopted by other hardware vendors and their developers in the Open Handset Alliance.
On Google’s Android source code download site alone, there are nearly 1.5 million downloads of Android. Also, Android’s mobile phone market share is growing from 4% in 4Q2008 to as much as 6-8% by mid 2009. Moreover, its ease of use and much lower barrier of entry due to Open Source makes Android accessible to more developers and users. Lastly, Android supports Adobe Flash+AIR platform while Apple’s iPhone still does not.

Download | here |.
And here is another for Beginning Android 2 | download link |.

3. The Android Developer's Cookbook - James Steele & Nelson To

Want to get started building applications for Android, the world’s hottest, fast-growing mobile platform? Already building Android applications and want to get better at it? This book brings together all the expert guidance–and code–you’ll need!

Completely up-to-date to reflect the newest and most widely used Android SDKs, The Android Developer’s Cookbook is the essential resource for developers building apps for any Android device, from phones to tablets.

Proven, modular recipes take you from the absolute basics to advanced location-based services, security techniques, and performance optimization. You’ll learn how to write apps from scratch, ensure interoperability, choose the best solutions for common problems, and avoid development pitfalls. Coverage includes:
  • Implementing threads, services, receivers, and other background tasks
  • Providing user alerts
  • Organizing user interface layouts and views
  • Managing user-initiated events such as touches and gestures
  • Recording and playing audio and video
  • Using hardware APIs available on Android devices
  • Interacting with other devices via SMS, web browsing, and social networking
  • Storing data efficiently with SQLite and its alternatives
  • Accessing location data via GPS
  • Using location-related services such as the Google Maps API
  • Building faster applications with native code
  • Providing backup and restore with the Android Backup Manager
  • Testing and debugging apps throughout the development cycle

Turn to The Android Developer’s Cookbook for proven, expert answers–and the code you need to implement them. It’s all you need to jumpstart any Android project, and create high-value, feature-rich apps that sell!

Download | here |.

4. Pragmatic Hello, Android - Ed Brunette
Android is a software toolkit for mobile phones, created by Google and the Open Handset Alliance. It's inside millions of cell phones and other mobile devices, making Android a major platform for application developers. That could be your own program running on all those devices.

Within minutes, Hello, Android will get you started creating your first working application: Android's version of "Hello, World." From there, you'll build up a more substantial example: an Android Sudoku game. By gradually adding features to the game, you'll learn the basics of Android programming. You'll also see how to build in audio and video support, add graphics using 2D and 3D OpenGL, network with web pages and web services, and store data with SQLite. You'll also learn how to publish your applications to the Android Market.

The #1 book for learning Android is now in its third edition. Every page and example was reviewed and updated for compatibility with the latest versions. Freshly added material covers installing applications to the SD card, supporting multi-touch, and creating live wallpaper. You'll also find plenty of real-world advice on how to support all the Android versions in use today-everything from Cupcake (Android 1.5) to FroYo (Android 2.2) and beyond.

If you'd rather be coding than reading about coding, this book is for you.

Download | here |.

5. Android Application Development

This practical book provides the concepts and code you need to develop software with Android, the open-source platform for cell phones and mobile devices that's generating enthusiasm across the industry. Based on the Linux operating system and developed by Google and the Open Handset Alliance, Android has the potential to unite a fragmented mobile market. Android Application Development introduces this programming environment, and offers you a complete working example that demonstrates Android architectural features and APIs. With this book, you will:

  • Get a complete introduction to the Android programming environment, architecture, and tools
  • Build a modular application, beginning with a core module that serves to launch modules added in subsequent chapters
  • Learn the concepts and architecture of a specific feature set, including views, maps, location-based services, persistent data storage, 2D and 3D graphics, media services, telephony services, and messaging
  • Use ready-to-run example code that implements each feature
  • Delve into advanced topics, such as security, custom views, performance analysis, and internationalization
The book is a natural complement to the existing Android documentation provided by Google. Whether you want to develop a commercial application for mobile devices, or just want to create a mobile mashup for personal use, Android Application Development demonstrates how you can design, build, and test applications for the new mobile market.

Download | here |.

Categories: , , , ,

Android Programming - Free Ebook (3)

1. Wrox - Android Application Development - Reto Meier
A hands-on guide to building mobile applications, Professional Android Application Development features concise and compelling examples that show you how to quickly construct real-world mobile applications for Android phones. Fully up-to-date for version 1.0 of the Android software development kit, it covers all the essential features, and explores the advanced capabilities of Android (including GPS, accelerometers, and background Services) to help you construct increasingly complex, useful, and innovative mobile applications for Android phones.
What this book includes
  • An introduction to mobile development, Android, and how to get started.
  • An in-depth look at Android applications and their life cycle, the application manifest, Intents, and using external resources.
  • Details for creating complex and compelling user interfaces by using, extending, and creating your own layouts and Views and using Menus.
  • A detailed look at data storage, retrieval, and sharing using preferences, files, databases, and Content Providers.
  • Instructions for making the most of mobile portability by creating rich map-based applications as well as using location-based services and the geocoder.
  • A look at the power of background Services, using threads, and a detailed look at Notifications.
  • Coverage of Android's communication abilities including SMS, the telephony APIs, network management, and a guide to using Internet resources
  • Details for using Android hardware, including media recording and playback, using the camera, accelerometers, and compass sensors.
  • Advanced development topics including security, IPC, advanced 2D / 3D graphics techniques, and user–hardware interaction.
Who this book is forThis book is for anyone interested in creating applications for the Android mobile phone platform. It includes information that will be valuable whether you're an experienced mobile developer or making your first foray, via Android, into writing mobile applications. It will give the grounding and knowledge you need to write applications using the current SDK, along with the flexibility to quickly adapt to future enhancements.


Download | here |.

2. Pro Android Games - Apress - Vladimir Silva

Android is Google’s software platform answer to the iPhone and BlackBerry, and at the very least, has advantages in terms of multitasking, running apps in the background and others.
Google’s partners in the Open Handset Alliance – supporting Android -- provide the devices, with HTC G1 and G2 already available now and 18 more Google Phones set to debut later this year according to Google I/O Conference news.
Pro Android 2 Games is the first book on Android Games development, and one of the first on Android 2.0. This book is a detailed look at building classic and fun games from scratch or porting classic games from other platforms to Android.

Download | here |.

3. Pro Android Media - Apress - Shawn van Every

Mobile devices have evolved to focus on rich media production and consumption. Developers of mobile applications are able to create applications that allow people to play, capture, and share media in a variety of new ways on mobile devices. The popularity of Android has soared in part because the platform offers developers a rich set of capabilities including access to media capturing and playback functions. 

Pro Android Media provides concise and clear instruction on how to utilize the media APIs made available through Android to create dynamic apps. It takes you from a simple means to gain access to the camera to complex video capture and sharing examples. It also covers sound, graphics, painting, and more—everything you need to make your app come "alive."

After reading this book, the app you create will showcase the best of multimedia that Android has to offer.

What you’ll learn

  • Develop graphics, music, video and rich media apps for Android smartphones and tablets 
  • Build touchscreen input features into Android apps that allow users to draw, paint, and do other creative forms of input
  • Turn the Android smartphone into a full fledged media player
  • Integrate and use location-based services and media-related web service APIs

Who this book is for

This book is aimed primarily at the growing market of Android developers. It is written in such a way that it may be used by those who are familiar with Android, but have no experience developing applications that deal with images, audio, or video.

Table of Contents

  1. Introduction to Android Imaging
  2. Building Custom Camera Applications
  3. Image Editing and Processing
  4. Graphics and Touch Events
  5. Introduction to Audio on Android
  6. Background and Networked Audio
  7. Audio Capture
  8. Audio Synthesis and Analysis
  9. Introduction to Video
  10. Advanced Video
  11. Video Capture
  12. Media Consumption and Publishing Using Web Services

Download | here |.

4. Pro Android Web Apps - Jonathan Stark & Reto Meier

Developing applications for Android and other mobile devices using web technologies is now well within reach. When the capabilities of HTML5 are combined with CSS3 and JavaScript, web application developers have an opportunity to develop compelling mobile applications using familiar tools. Not only is it possible to build mobile web apps that feel as good as native apps, but to also write an application once and have it run a variety of different devices.

While the HTML5 specification is still evolving, there is a lot that can be used right now to build mobile web apps. Mobile web apps are now starting to provide many of the features that were once only available to native-language-based apps in Java, Objective-C, etc. Pro Android Web Apps teaches developers already familiar with web application development, how to code and structure a web app for use on the Android mobile platform.
  • Understand both the why and how of mobile web app development, focusing on the Android platform.
  • Learn how to structure mobile web apps through a number of practical, real-world application examples.
  • Discover what cloud platforms such as Google AppEngine have to offer Android web apps, for both hosting web apps and providing device to cloud data synchronization solutions.
  • Get a real picture of the status of HTML5 on Android and other mobile devices, including some things to watch out for when building your own applications.
  • Understand the capabilities of the web application stack, and how to complement those with native bridging frameworks such as PhoneGap to access native features of the device.
  • Gain an understanding of the different UI frameworks that are available for building mobile web apps.
  • Learn how to include mapping and leverage location-based services in mobile web apps to create engaging mobile experiences.
  • Enable social integration with your Android web app and gain access to millions of potential users. 
After reading this book, you will not only have a greater understanding of the world of web apps on Android, but also how to leverage additional tools and frameworks to increase the reach of your mobile web apps. Additionally, through the practical samples in the book you will have been given solid exposure of where both the opportunities and challenges lie when building mobile apps the web way.

What you’ll learn

  • What Android web apps can do, and when to use web development rather than native development to create an application.
  • How to use existing JavaScript and CSS frameworks to create rich mobile user interfaces.
  • When to use HTML5 and when to use a native bridging framework to access native Android functionality.
  • Connext with cloud services and APIs to build engaging location based services and games.
  • Enable social integration with your Android web app and gain access to millions of potential users.

Who this book is for

This book is targeted at web developers looking to transfer their skills over to mobile application development. Readers will understand that Android is continuing to gain momentum in the marketplace and will want to build an application specifically for that platform. They will have a strong desire to use web technologies rather than the native tools to build applications, either due to personal taste or to gain cross-platform mobile portability for the majority of their application code.

Table of Contents

  1. Getting Started 
  2. Building a Mobile HTML Entry Form 
  3. HTML5 Storage APIs 
  4. Constructing a Multipage App
  5. Synchronizing with the Cloud
  6. Competing with Native Apps 
  7. Exploring Interactivity
  8. Location Based Services and Mobile Mapping 
  9. Native Bridging with PhoneGap
  10. Integrating with Social APIs 
  11. Mobile UI Frameworks Compared 
  12. Polishing and Packaging an App for Release
  13. The Future of Mobile Computing
  14. Appendix: Debugging Android Web Apps

Download | here |.

Categories: , , , ,

Android Programming - Free Ebook

I'll upload some of my ebook collection to 4shared so you can download it.
1. I advice you to have a look at this Google IO 2010 presentation. It is simple but very good as a fundamental for beginning Android Application Development.

Download | here |.
2. Then for another simple yet powerfull ebook, I recommend Andbook from AndDev. You can download directly from it site. Here is the | link |.

3. Android A Programmer's Guide - J.F DiMa
(copy paste from amazon ^-^ )


Build compelling Java-based mobile applications using the Android SDK and the Eclipse open-source software development platform. Android: A Programmer's Guide shows you, step-by-step, how to download and set up all of the necessary tools, build and tune dynamic Android programs, and debug your results. Discover how to provide web and chat functions, interact with the phone dialer and GPS devices, and access the latest Google services. You'll also learn how to create custom Content Providers and database-enable your applications using SQLite.
  • Install and configure Java, Eclipse, and Android plugin
  • Create Android projects from the Eclipse UI or command line
  • Integrate web content, images, galleries, and sounds
  • Deploy menus, progress bars, and auto-complete functions
  • Trigger actions using Android Intents, Filters, and Receivers
  • Implement GPS, Google Maps, Google Earth, and GTalk
  • Build interactive SQLite databases, calendars, and notepads
  • Test applications using the Android Emulator and Debug Bridge

Download | here |.
4. Android Documentation - Compiled by Fastop
Another good point to start.

Download | here |.

5. Sam's Teach Yourself Android Application Development 24 Hours - Lauren Darcy & Shane Conder

In just 24 sessions of one hour or less, learn how to build powerful applications for the world’s first complete, open, and free mobile platform: Android. Using this book’s straightforward, step-by-step approach, you’ll build a fully-featured Android application from the ground up and master the skills you need to design, develop, test, and publish powerful applications. Each lesson builds on what you’ve already learned, giving you a rock-solid foundation for real-world success!

Step-by-step instructions carefully walk you through the most common Android development tasks.
Quizzes and Exercises at the end of each chapter help you test your knowledge.
By the Way notes present interesting information related to the discussion.
Did You Know? tips offer advice or show you easier ways to perform tasks.
Watch Out! cautions alert you to possible problems and give you advice on how to avoid them.

Learn how to…
  • Develop Android applications quickly and successfully with Java
  • Master Google’s Android SDK and development tools
  • Leverage the Eclipse programming environment to develop Android projects
  • Understand the Android application lifecycle
  • Build effective, user-friendly user interfaces
  • Retrieve, store, and work with application data
  • Develop powerful network applications
  • Add popular social features and location-based services to your applications
  • Take advantage of Android device hardware like the camera
  • Internationalize, test, and publish your Android applications

Download | here |.

Categories: , , , ,

Friday, September 30, 2011

Belajar dari Sopir Taxi

Lagi-lagi menemukan artikel yang sangat baik untuk di share mengenai bersyukur. Kali ini dari blog Bro Johanes Gunawan (namanya mirip ya?hehe). Lagi-lagi sekedar copas, daripada mengurangi arti penting dari setiap untain kata penulis aslinya.
Seni Hidup #1 Bersyukur

Pada dasarnya manusia memang tidak pernah puas termasuk tidak pernah puas dengan pekerjaan yang kita lakukan sekarang. Sehingga kita bersungut-sungut dan mengeluh dengan keadaan kita sekarang seperti layaknya kita adalah orang paling malang sedunia.
Di balik benar atau tidak kutipan cerita dari email yang saya terima hari ini (moga-moga kisah nyata), paling tidak mengingatkan kita supaya kita bersyukur dalam segala hal karena justru sebenarnya ada banyak orang yang lebih susah dari kita yang harus kita tolong (Efesus 5:20). Mengingatkan kita supaya kita mencari dahulu Kerajaan Allah dan KebenaranNya, yang artinya mengutamakan Tuhan di atas segala hal (Mat 6:33).
Ujung-ujungnya bahwa kita hidup di dunia bukan untuk diri sendiri, melainkan untuk Tuhan semata.
Soli Deo Gloria…
SUATU SAAT DALAM TAXI
 Selamat Membaca, Tuhan memberkati 
“Jika kita melakukan sesuatu, lakukanlah semuanya seperti kita melakukan untuk Tuhan”.
Hari-hari terakhir pekerjaan kantor sangat melelahkan. Tidak ada waktu untuk ‘memanjakan’ diri sendiri. Bahkan saat akan beristirahat pun, segala masalah dan tugas dalam pekerjaan selalu menghantui pikiran. Terus terang saya sudah malas dengan segala keinginan boss-ku. Nyaris setiap hari aku pulang larut malam. Pergi pagi pulang malam. Dari Senin sampai Sabtu. Dan segala pekerjaanku tidak pernah di hargai olehnya. Jadi aku pikir “masa bodoh dengan segala pekerjaan kantor. Aku sudah cape. Terserah deh, nanti jadinya apa. Gua kaga peduli”. Jadi Sabtu kemarin aku habiskan waktu dengan tidurseharian. Membaca buku, menonton televisi, dengar kaset. Laptop yang tegeletak di atas meja tidak aku sentuh sedikit pun. “Masa bodoh” pikirku.
Sendok suapan terakhir telah masuk ke dalam perut. Wah, kenyang juga. Kubenahi segala dokumen yang di butuhkan dan segera keluar kantor mencari taxi. Sudah 5 menit aku menunggu, akhirnya taxi yang kutunggu datang juga.
“Daerah kota pak,” seruku pada supir taxi.
“Kotanya di mana pak?”, dia menimpali.
“Wah, namanya apa yah?” aku sendiri tidak begitu ingat. “Nanti saya tunjukkan jalannya kalau sudah sampai di sana ”
“Baik Pak”. Suasana hening.
Tidak beberapa lama pak supir berkata, “Tadi orang yang pakai taxi ini sebelum Bapak, naik dari Taman Anggrek”.
Dekat amat pikirku. Kantorku ada di daerah Citraland.
“Kok mau sih pak?” ucapku.
“Wah tidak baik menolak rejeki. Kalau Tuhan sudah kasih berkat, masa kita tolak”, ujarnya dengan logat batak yang masih terasa. “Kalo supir lain sih
pasti nolak. Kalau saya, ngak masalah, dekat atau jauh toh berkat dari Tuhan.”
“Wah, berfilsafat dia.”, pikirku.
“Tapi sebenarnya untung juga sih kalau nariknya deket. Tadi saja saya di kasih uang 10.000. padahal argonya ngak sampe 5 rebu. Saya senang juga.
Tapi sebenernya saya ngak tega kalo mesti nolak. Dia kan pasti mau buru-buru. Bagaimana rasanya, sesudah duduk, eh malah saya tolak. Sakit hati kan “.
“Iya juga yah”, pikirku.
Suasana hening kembali.
Kuperhatikan wajahnya dari kaca mobil. Keliahatannya ceria, tidak seperti sopir-sopir taxi yang lain. Yang rata-rata wajahnya cemberut. “Bapak sudah
lama jadi sopir taxi”, tanyaku memecah keheningan.
“Baru empat tahun Pak.”
“Sebelumnya kerja di mana?”
“Dulu saya kerja di perhotelan.”
“Kerja di bagian apa Pak?”
“Manager operasional”
Hah? Tidak salah dengar ? Manager ? Gak mungkin ah.. “Anak buahnya banyak pak?”, tanyaku sedikit menyelidik.
“Ada sekitar 100 orang”   “Terus, koq sekarang malah jadi sopir taxi”
“Wah, panjang ceritanya Pak.”
“Oh.”, gumamku dan tidak bertanya lebih lanjut, kelihatannya ada kenangan pahit yang dia alami.
“Biasalah pak korban kena sikut”, ujarnya meneruskan, “Padahal dia teman baik saya. Tidak menyangka dia akan berbuat seperti itu. Tapi buat saya itu ngak masalah. Saya percaya Tuhan pasti akan tetap pelihara saya. Buktinya saya langsung bisa dapat pekerjaan lagi. Walaupun tidak sehebat seperti dahulu. Yah, sudah cukup lah, untuk kebutuhan sehari-hari”.
“Kenapa Bapak tidak mencoba melamar di hotel lain?”
“Nama saya sudah rusak Pak.”
“Pasti karena di fitnah oleh teman baiknya itu”, pikir ku.
Kuperhatikan lagi wajahnya. Tetap ceria seperti tadi. Tidak nampak terbeban.
“Lebih enak jadi sopir atau kerja seperti dulu Pak?”, tanyaku.
“Wah, enak atau enggak tergantung hati kita Pak. Pokoknya kita mesti sadar, bahwa apa yang kita punya saat ini, Tuhan yang memberi. Mengucap syukur
senantiasa. Sukacita bukan datang dari luar, tapi dari dalam diri kita. Jadi kalau ditanya lebih enak mana, dulu atau sekarang, jawabannya yah: dua-duanya. Mau jadi apa aja ngak masalah, yang penting ada rasa syukur, pasti sukacita itu datang dengan sendirinya.”
Wah, jadi malu aku. Aku yang sejak kecil di didik dalam keluarga percaya, masih mengeluh kan pekerjaan yang saya terima. Padahal kalau dibandingkan
dengan sopir taxi, pekerjaan saya jauh lebih enak. Dengan penghasilan yang lebih tinggi tentunya. Tapi, dasar ! Nggak ada ucapan syukurnya. Aku jadi
teringat akan nasehat yang mengatakan “Jika kita melakukan sesuatu, lakukanlah segala sesuatu seperti kita melakukan untuk Tuhan”.
Hmmm, hari ini aku di sadarkan kan oleh seorang supir taxi. Hari ini aku dikuatkan kembali untuk selalu bersyukur dalam segala hal.
Anak-Ku, Aku tahu bahwa kadang kala begitu menggoda untuk menyerah dalam kehidupan. Kadang kala sulit menemukan alasan untuk terus berusaha. Apa yang membuatmu merasa seperti menerima kekalahan? Sekolah? Nilai? Kawan-kawan? Orangtua? Uang? Perang? Dengarlah, Aku ingin kamumempercayai-Ku dalam hal ini. Meskipun keadaan hidup tampak kacau dari luar, tetapi jika kamu percaya kepada-Ku, ada hal-hal yang tak terlihat terjadi di dalam dirimu. Setiap hari, Aku membuka sesuatu yang baru dan menggairahkan. Masa depanmu akan lebih mengherankan dari apa pun yang dapat kamu bayangkan. Percayalah kepada-Ku, tidak akan sia-sia kamu bertahan karena ada hari depan yang indah menunggumu. Oleh karena itu, bertahanlah dengan gigih.Janganlah menyerah! Aku mempunyai sejumlah kejutan nyata bagimu. Apa gunanya seseorang memperoleh seluruh dunia tetapi kehilangan nyawanya? Apakah yang dapat diberikannya sebagai ganti nyawanya? (Mat 16:26)
Bapa Engkau Sungguh baik,
Kasih Mu melimpah dihidup ku
Bapa ku berterimakasih, berkatMu hari ini yang Kau sediakan bagi ku
Kunaikkan syukur ku buat hari yang Kau beri
Tak habis – habisnya, kasih dan rahmatMu
Selalu baru dan tak pernah terlambat pertolonganMu
Besar setia-Mu disepanjang hidup ku.

Categories: , , ,

Copyright © Johannes Dwi Cahyo | Powered by Blogger

Design by Anders Noren | Blogger Theme by NewBloggerThemes.com | BTheme.net      Up ↑