Saturday, June 9, 2012

Android Shopping Cart Tutorial Part 3

In this part of the Android Shopping Cart Tutorial we will add prices, and calculate the total price for the purchase.


This tutorial is part of a series about building an android based shopping cart, and will build off of existing code and concepts discussed in Android Shopping Cart Tutorial and Android Shopping Cart Tutorial Part 2.

Step 1. Prices for Products

In our previous tutorials we learned how to display different products, add them to the cart, and even change the quantity of those products. Now we must add another crucial component, the price.

If you look back at the previous tutorials, our Product object already contains price information, and our initial catalog is setting prices--these prices simply are not being displayed in the app anywhere.

Tuesday, May 1, 2012

Creating a Custom View That Takes Attributes

This tutorial will demonstrate how to create a custom view that will change its appearance based on a custom attribute set in the xml layout.


1. Custom Attributes

If you have used Android Views in the layout editor, you are probably already familiar with setting attributes for views. For example, for an ImageView you can set the drawable attribute to determine what graphic to draw, or the Text Attribute for a button or label to determine what text will display.

If you find yourself designing a custom view, you may want to add custom attributes to that view that affect the display or behavior. For this example we will build off of the custom view that created before, and add an attribute to change the border color.

Sunday, April 29, 2012

Featured App: Super Monster Puncher IRL

Today we want to showcase this game one of our awesome friends made.
It is called Super Monster Puncher IRL.

From the game's description:
There are a lot of monsters out there, so you better punch them all. Turn your GPS on, explore your local stores, and see what kind of monsters show up for the punching.
Punch over 30 monsters and gain experience up to level 9 in this lite version. Get the full version to get more monsters, more levels, and more punching!


The game has some really neat artwork and it is fun when you change locations and find new monsters. Besides, it's reminiscent of one of my favorite childhood games. Show them some love and let us know what you think.

Google Play Link: http://bit.ly/Jlye7M.

Tuesday, April 24, 2012

Friday, March 9, 2012

Creating a Simple Custom Android View

This tutorial will show you how to create an extremely simple custom view that draws a red border, and add this view to a layout.


1. Why Create a Custom View?

You may be wondering why you would ever want to create a custom view. Android comes with many views already, and these views follow behaviors that the user expects and has grown accustomed to (buttons, check boxes, text inputs). These views are fine and work great, but sometimes they do not provide all the functionality that your apps requires, or you may simply wish to build a more customizable component.

Thursday, February 23, 2012

Debug Certificate Expired

When you are building your android applications you don't really want to have to worry about signing your app before you install it on a device just for testing purposes.

Thankfully, the Android Development Tools will take care of this for us, and when you run your application from Eclipse, the Android plug in will automatically take care of signing the app with a debug certificate.

However, if you have been developing Android apps for more than a year, you may have run into the following problem.

Error generating final archive: Debug Certificate expired on...


Saturday, February 11, 2012

How to Modify the AndroidManifest

In previous tutorials we have reminded you to modify the manifest file and we have gotten a lot of questions about how to do it. Here is the general answer.

As you know, our tool of choice (IDE) to create Android apps is Eclipse.
So here is how you can do it step by step. [Note: If you don't use Eclipse then you just have to modify the AndroidManifest.xml file in your application]


1. In your package explorer tab (In the image to the left you) click on the AndroidManifest.xml
2. In the main window you will see a set of tabs at the bottom  (blue in the image. We find it easier (but also more prone to mistakes) to modify the .xml file directly, so click on that tab.
3. Now, all you have to do is update it to your needs. The most common problem is to change the activity, so in this example you can swap <activity ..... > .... </activity>  with the new one.

In short, two of the most important tags are:

  • Activity - describe the different activities your app contains and settings for them
  • Permissions - describe which features your application wishes to use that are not normally included (internet access for example)

If you want to know more about the manifest and what each of the fields means you can find more information  from the official android documentation here.

We hope this helps, we will be bringing new material soon if you have any suggestions then write a comment, send us an email or find us on twitter.

Tuesday, February 7, 2012

Pardon the Dust

Ahhh, We meet again.

Sorry for abandoning the blog for a few months, computer problems coupled with busy schedules are our excuse. However, we have exciting news: 

We are about to launch an improved Android Drom blog.

What does this mean for you?

* Update to all our old tutorials which includes putting all the code in github
* New tutorials just for you
* Help sessions - specific hours where you can ask and we'll answer

We are really sorry if we didn't reply to your email but it is really hard to try solving all the problems with the your code. Our goal while posting these tutorials is to provide a point of reference. However, in these help sessions that we are planning on hosting you can expect real-time answers to your questions.

Finally, we are doing this as a hobby, so please bear with us, and if you like what you see and would like to show your appreciation, consider buying us a cup of coffee so we can keep going.

Sincerely, 
The Android Dom team.