Pick a Deal – Customize Deals and Coupons You Receive

I just published a new daily deals Android app, Pick-a-Deal in Google Play this week end.

What is Pick-A-Deal?

Pick-a-Deal is an app that gives power to users by letting them personalize what kind of deals, promotions, or coupons they would like to receive. For example, if a user is interested in buying a new home, she or he will have to subscribe to that channel to receive new houses deals or promo material from realtors who are in the local market as well as financing information from banks. The same apply to other products, services or informational that users might be interested to.

No need to chase deals from one website to another, or have to download apps from different stores or services. The concept is very simple and straight forward. Consumers need to have a say on what and when they want. I believe this is the best approach for both party, namely consumer and business. Consumers will be able to get what they need, when need it and business will be able to timely compete and target the right group. Doing so will lead to a better decision making during the process as well as real competition among businesses.

The other great thing about this app is, user can only subscribe local if she or he choose to. What does this mean? If a user subscribe to local market, she/he will only receive promotional materials from local businesses. The aim is to support local businesses and help grow economy.

If you are a local or nationwide business owner, the app provides a great opportunity to reach your customers who a looking for a specific product that your business offers. With eCommerce, business can promote their products to millions of subscribers in a matter of seconds.

Pick-a-Deal is for everyone. If you are small business owner with a store front, eBay store, eCommerce site or a niche blog that sells a product, Pick-a-Deal is for you. It is affordable to everyone and you reach potential customers right away. Reach millions of customers in a matter of seconds!

Finally, we want to hear from you, users and advertisers. We will hear any idea you might have to improve your experience in order to meet or exceed your expectation.

Android Apps , , ,

SharedPreferences Between Applications and Mode Parameter

On my last post, I wrote about SharedPreferences Between Activities and how one activity can retrieve persistence data saved by another activity on the same application. But what if an application needs to access some sort of data stored in SharedPreferences from a totally different application? That’s what I will cover today.

Also, I will touch on something I left out in my last post, that’s mode parameters that you should pass when creating SharedPreferences objects. It will be something short and straight forward for everyone who’s wants to implement it.

Starting with SharedPreferences between applications, one application can access preferences from another application simply by referencing the first application package name plus a proper mode parameter. Lets say PackageTwo needs to access a preferences from PackageOne. Assuming that the first application preference was defined as a constant with a PREF_NAME name, this is how to access it.

 

Now, the second application can store or retrive values from PackageOne using the secondPreference object.

 

So far I have passed MODE_PRIVATE on all the SharedPreferences objects I have created. If MODE_PRIVATE or 0 is passed as parameter, the read and write access will only be allowed to the application that created the preference.

There are two more parameters that can be passed which are MODE_WORLD_READABLE or 1 and MODE_WORLD_WRITABLE or 2. Both modes give shared preferences access between applications. Depending on how your application is going to share data, be certain that a proper mode is passed.

Android Development Tutorials , , , ,

Shared Preferences Between Activities – How to Retrieve Values

It can be tricky or frustrating when your application needs to share data between two or more activities in a very simple way. I am saying this from my own experince especially when I started developing Android apps. Soon you will realize how simple it is to store strings or numbers and retrieve between activities.

By creating SharedPreferences object, you can accomplish just that and your data will be persistance. Depending on what kind of application you are doing, the data can be anything from log in information, todo list or anything that can be stored in the key/value form.

To illustrate this, look at the two activities below. The first activity creates a shared file that will be accessed with two or more activities. I do assume that you can create a new project since I will not cover that part.

Create your first activity and give it any name. My activity keeps track of team’s score. Layout file is not shown in the example but I will reference each view that is in the layout.

 

Now lets access scores stored in SharedPreferences object. Again, layout file is not included below but I am going to initiate and reference all the views from it. Pay attention on how I access the SharedPreferences file.

 

To show a score for a specific team, a user will type in team’s name and press the “Show Score” button. If a user misspelled team’s name or one that’s not stored, the “Team not found” message will be displayed.

As you can see, shared preferences between activity above has been accomplished by accessing the file name that is declared as constant in TeamScore activity. All data stored in the file can be accessed by creating SharedPreferences the same way. This will not work for Shared Preferences between applications.

Android Development Tutorials , ,

How to Hide the Title Bar in Android

An activity with title bar removed

No Title Bar – eBay Fee Calculator

How do you hide the title bar on an application in Android? I have seen this question over and over again. As a developer, you must use the small screen size very wisely when laying out your app. Yes, new phones come with a bigger screen size nowadays but still you need to make sure that all users who can potentially download your app are able to use it.

So, depending on what kind of an app you are developing, gaining few pixels by removing the title bar can go long way. I am sure if you are developing a game, you will appreciate every extra pixel you can get which in turn will improve user experience.

You can remove or hide the title bar or status bar from your activity in two ways. The one way I have used in almost all my apps is through WindowManager in an activity. It is very simple and you only need to import android.view.Window and write one line of code. WindowManager has other few features that can help you customize the look and appearance of your activity window.

Here’s how you can remove or hide title bar applied in an activity.

What if I have my own custom title? I am glad you asked. You can set custom title to an activty if you have one made in your layout resource. Following along the same lines, first you will have to request window feature as shown above and then you have to call the custom title from resources. I will show you how to create a custom title in the future.

Again, here’s hide or remove title bar by setting a custom title.

It is very important that requestWindowFeature() is made before setContentView(). If the feature request is made after, the default title will remain in place. Also, it is worth to mention that both FEATURE_NO_TITLE and FEATURE_CUSTOM_TITLE cannot be used with any other Window features because the default title is completely replaced.

The second way that you can use to remove status bar from window is by applying custom theme in the manifest file. Custom theme can be applied to a selected activity or the entire application. I will not go into how to create custom themes today but if you have one in place, you can easily apply in the manifest file as follows. Assuming style.xml is the file inside resources folder with “noStatusBar” and “noTitleBar” theme names.

Apply custom theme to remove status bar and hide title bar on individual activities.

That’s it for today. I hope this tutorial will shed some light on how to hide title bar and help you customize your activity’s title bar or status bar.

Android Development Tutorials , , , , ,

How to Create Scrolling TextView in Android.

On my last tutorial, I showed you how to create drawable background in Android using XML. Today I will shift gears to show you how to create an app with a scrolling TextView across the screen. Not exactly sure why you would do that but hey, there are so many ideas out there and scrolling text can be useful to someone who needs it.

This tutorial will be short and easy to understand even for beginners who are looking for easy way to learn Android app development. Before I show you how to implement, you need to have your specific Android project ready with its an XML file that you are going to add scrolling text.

Although Android TextView has built in marquee feature, this option alone is not enough to make displayed text scroll across the screen. Setting android:ellipsize=”marquee” is just a key step to avoid long text from being truncated. I will show you in a second what other attributes and their respective options that need to be declared in your XML layout file.

Now lets create a scrolling text that repeats 10 times. Open your XML layout file, decide which  TextView to scroll and set its attributes as shown below.

As you can see, XML layout does the heavy lifting. I have declared two extra attributes, android:singleLine=”true” and android:scrollHorizontally=”true”.  The two attributes help position the TextView properly and make the text longer than the screen view. To make scrolling animation happen magically, set selected state to true in the main Java file.

If you want the text to scroll indefinitely, set android:marqueeRepeatLimit=”marquee_forever”. One important point to remember about marquee feature is, the text will only scroll when it is focused or selected. So if you run your project and nothing happens once the emulator is up and running, don’t panic.

That’s it for today and hope it will help you on whatever project or app idea you are trying to accomplish.

Android Development Tutorials, Android Layouts , , , , ,