background preloader

Develop Android apps

Facebook Twitter

Stackwidget - StackView Widget. 14 Great Android apps that are also open source. Android advanced android interview questions and answers paper 16. 15 Online Courses To Make You An Android App Developer. Using lists in Android (ListView) By default a ListView has no selection mode active.

Using lists in Android (ListView)

You can activate it via the setChoiceMode() method call. Pass ListView.CHOICE_MODE_MULTIPLE for multiple selections or ListView.CHOICE_MODE_SINGLE for single selections to this method. To get the selected items of a ListView, use the getCheckedItemPosition() for a single selection method or listView.getCheckedItemPositions() for multiple selections. If you have stable ID, you could also use the getCheckedItemIds() method to get the selected IDs. Android Tab Layout with Swipeable Views. My previous article explains about Android Tab Layout and it got very good ranking in search engines.

Android Tab Layout with Swipeable Views

But unfortunately TabHost is deprecated by android in favor of fragments. So it is suggested that use fragment to achieve tab layout. This article shows you how to create tab layout using fragments and viewpager. Also you can swipe between tab view as it is the functionality of viewpager which is not possible when using TabHost. Android:Playing Sound Effects With SoundPool/Source/ Handling Media with Android. Handling Media with Android - Tutorial Copyright © 2010 - 2011 Lars Vogel Android Media - Sounds This tutorial describes the usage of the Android media API for playing and recording sound.

Handling Media with Android

Free Sound Effects. How to Get Support - FEST. It is possible to get outstanding support from open source communities if you know how to work with them.

How to Get Support - FEST

Please follow its rules and etiquette. How Open Source Community Support Works Most open source communities are made up of volunteers. Its members are not paid to provide support. They're there to help each other and help the project. As a result, it is very important on mailing lists to be respectful and to value others' time. Asking Questions the Right Way When I see a question on a list or forum, I usually scan and make a very quick decision on whether I would be able to help.

Get to the point quickly. Remember: If you make it hard to help you, fewer people will try. Your Reputation Longer term, how much support you receive from an open source community will depend on your reputation in it. Org.robolectric Class Hierarchy (Robolectric 2.2 API) Unit testing Android apps is easy with Robolectric. Robolectric unit tests can verify expected application behavior, saving you the trouble of deploying your Android app to a device or an emulator.

Unit testing Android apps is easy with Robolectric

Unit testing offers significant advantages as a development practice and helps ensure higher quality code with fewer defects. Unfortunately, unit testing Android apps can be challenging. The Android SDK provides an API that makes assumptions about the environment in which it executes. [SCREENCAST] How to do Unit Testing on Android with Eclipse - May 2nd, 2010 1 minute reading time.

[SCREENCAST] How to do Unit Testing on Android with Eclipse -

I was going to make a tutorial, but then I figured that making a video would be a much better way to show this. As for the code that you could grab from a tutorial, there’s a link at the end of the post with all the code shown in the video demo. The video demo covers how to create and run Unit Test classes for regular Java classes on Android, and also how to create and run Unit Test classes that test classes that depend on Android “Context” or “Activity” objects.

If your Android unit tests are not running because of frustrating error messages, the time spent watching this video will save you a lot of reading and headaches. Check the screencast after the break. Tutorial: Android Testing In The Cloud With Android Studio, The New Gradle Android Build System and Manymo - Manymo. June 17/2013, by Dan Grigsby Overview This tutorial shows how to use Android Studio, the new Gradle Android build system, and Manymo to test Android app Activities in the cloud.

Tutorial: Android Testing In The Cloud With Android Studio, The New Gradle Android Build System and Manymo - Manymo

Testing With The New Gradle Android Build System Under the new Gradle Android Build System tests are no longer segregated in a separate test project; they're part of the app's src tree. In the next steps we'll create a simple project and add tests to it: Spoon. Introduction Android's ever-expanding ecosystem of devices creates a unique challenge to testing applications.


Spoon aims to simplify this task by distributing instrumentation test execution and displaying the results in a meaningful way. Instead of attempting to be a new form of testing, Spoon makes existing instrumentation tests more useful. Using the application APK and instrumentation APK, Spoon runs the tests on multiple devices simultaneously. Once all tests have completed, a static HTML summary is generated with detailed information about each device and test. With the high-level output you can immediately see whether or not a test failure is specific to a single device or all devices. Robolectric. Blog. The Resurrection of Testing for Android. April 03, 2013 When testing Android applications, documentation and tools can be sparse.

The Resurrection of Testing for Android

At Square, verifying the behavior of our applications is an essential part of our day-to-day development—and to make testing easier, we have created and refined a set of tools for three different aspects of testing; unit tests, instrumentation tests, and declaring assertions. Robolectric The most fundamental problem which inhibits testing is that the API jar for each version of Android is empty. Rather than having actual code, the provided jars are filled with code that looks like this: public class View { public View(Context context) { throw new RuntimeException("Stub!

") As you can imagine, having every constructor and every method in the entire platform immediately throw an exception prevents any real tests from being written. Robotium - The world's leading Android™ test automation framework. Robotium is an Android test automation framework that has full support for native and hybrid applications.

robotium - The world's leading Android™ test automation framework

Robotium makes it easy to write powerful and robust automatic black-box UI tests for Android applications. With the support of Robotium, test case developers can write function, system and user acceptance test scenarios, spanning multiple Android activities. See Questions & Answers for common Robotium questions and answers. See Getting Started for instructions and examples on how to create your first Robotium tests. Join the discussions in the Robotium Developers Group. NEWS: Robotium 5.1 is released! Robotium 5.1 is the fastest, most accurate and stable version of Robotium yet. New functionality includes: pressSoftKeyboardSearchButton(), getWebElements(), setNavigationDrawer(int status), getConfig() and more.

Robotium provides the following benefits: Android Unit and Integration testing · thecodepath/android_guides Wiki. Overview Automated Testing is an important topic that helps us ensure quality when building Android apps. There are many different testing tools and frameworks we can use while developing Android apps. This guide will take a look at the most popular approaches available. Usage. Android Application Testing Guide - Diego Torres Milano - Google Books. Build a Blog Reader Android App Project. Liven up your ListView The ListView can be customized in many ways. Take a look at the methods or XML attributes you can use to change how your ListView looks, and make it snazzy! Clicks Ahoy! Android Persistence with preferences and files. Android Persistence with preferences and files - Tutorial Copyright © 2010, 2011, 2012, 2013 Lars Vogel.

Android Architecture: Part 3, The Model - Android Developer. Android Auto Complete Tutorial. If you want to get suggestions , when you type in an editable text field , you can do this via AutoCompleteTextView. It provides suggestions automatically when the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with. In order to use AutoCompleteTextView you have to first create an AutoCompletTextView Field in the xml. Its syntax is given below. After that , you have to get a reference of this textview in java.

Android Tutorials for Beginners: Android Gallery View Example. A Gallery is a View commonly used to display items in a horizontally scrolling list that locks the current selection at the center.Gallery can be used to show Views in a horizontal list, and user can select a View , User selected view will be shown in center of the Horizontal list The items of Gallery are populated from an Adapter, similar to ListView, in which ListView items are populated from an Adapter.We need to create an Adapter class which extends BaseAdapter class and override getView() method. getView() method called automatically for all items of Gallery (similar to list view in which getView() method called for each item of ListView)

Create a Music Player on Android: Project Setup. The Android platform provides resources for handling media playback, which your apps can use to create an interface between the user and their music files. Image Gallery Example in Android. Android Developers Blog. [This post is by Philip Milne, who is part of the Android framework team. — Tim Bray] Ice Cream Sandwich (ICS) sports two new widgets that have been designed to support the richer user interfaces made possible by larger displays: Space and GridLayout. The most commonly used class for layout in Android is LinearLayout, which allows its children to be aligned in the usual ways: along either the horizontal or vertical axes. It’s often possible to take a complicated layout and break it down into a set of nested linear layouts and, provided this nesting doesn’t get too deep, this is still a good choice for many simple layouts.

Android Compatibility: Working with Fragments. Android 3.0, or Honeycomb, came with some fundamental user interface changes, most notably in the form of the Fragment API. When you were reading the last tutorial on how to use fragments, you were probably thinking, "Wow, this is great, but I can't use any of this because I need to target more than just the Motorola Xoom, the only Android 3.0 device currently on the market. " Luckily for all of us developers, Google has released a library called the Android Compatibility package. Android User Interface Design: Working With Fragments. The new Fragment API for Android, introduced in Android 3.0, allows for easier dynamic user interfaces. Android spinner (drop down list) example. Android Expandable List View Tutorial. Creating Swipe Views with Tabs. Swipe views provide lateral navigation between sibling screens such as tabs with a horizontal finger gesture (a pattern sometimes known as horizontal paging).