Archive for June, 2011

More Progress

Working on creating the app widget now.

Turns out creating the app widget is extremely difficult. Mostly with the designing process. I want to make it visually appealing, in other words, I want to make it PRETTY! BEAUTIFUL! Perfect! hahaha, I’m such a perfectionist.. =[

So far, I’ve already designed how the widget will look. Got the BASIC functionality down. I could create a widget and get it to work. However, i just threw in some random squares of colors for that. Looks terrible, but it works. However, I only tested that for a pre-configured widget… just to test if I can get widgets working.

Need to work on a configuration part for users to choose the locales they want. But before that, I REALLY need to start getting it to look better. Sadly, its been a long long long time since I used photoshop. Kind of forgot how to use it. This part is going to take me a while.

I’ve been thinking about how I’m going to release it. Well, more on that next time.


Read Full Post »

First of all, CONGRATS to my sister for graduating High School today!

Okay, now that that is out of the way, let’s talk about the progress.

I’ve edited most of the code.

Moved the whole update phone language part to a new class file that extends BroadcastReceiver instead of Activity. Since i’ll be using intents to do this stuff, I read a little about BroadcastReceivers and how they only live for as long as the onReceive() method is running. This fits the changing language plan much better than just sending an intent to an activity and have it go from there.

Now, time to talk about the hardships. I was struggling quite a lot on making the whole intent thing work. After a while, I found out I needed to declare intent-filters in the manifest.xml file. Afterwards, I thought it was smooth sailing from there, however, turns out I had put the WRONG intent-filters.

Definitely need to keep this in mind in the future. Especially since intents are a very major part of Android Apps. What I needed to do this time, was that I needed the intent-filter to have <action android:name=” .ChangeLocale” />. That part should be under the <receiver> tags.
In addition to that, to send the broadcast, I would need to create an intent and declare the class that I am sending the intent to.

Intent intent = new Intent(".ChangeLocale");
intent.putExtra("locale", new LocaleInfo(correctList.get(position)).getLanguageTag());

This should send out the intent broadcast. The manifest file will help me pick out the right receiver if it matches. Since it matches my ChangeLocale class, the intent is received and then I can use String localeCode = intent.getStringExtra(“locale”); 

Anyway, that was all the bad news. The GOOD news though, is that I got it working.

Next time, I will start to design the widget appearance and that stuff.

Read Full Post »

Wow tiring!

Too much tennis is VERY tiring.

Anyway, I took a look at the Locale Settings part in the Android Source Code.

Didn’t really help me much. Not sure if I was able to find my answer. Or possibly, I did find my answer, except I don’t have the correct permissions in the manifest.xml file.

Will continue to think about this problem, before I work on anything else.

I did come to the conclusion that this first project was actually MUCH tougher than it originally appeared. It didn’t occur to me that changing the phone language was really a very advanced topic. =/ oh well, if it works out, i’ll definitely benefit from the experience. If it doesnt’ work out… I might have to put the project on hold for a while and work on others before I go back to it.

Sadly, I’m too stubborn to give up! Time to think about that language problem in a different perspective!

UPDATE: =] Good news for me! I got it to work! This time, I’m positive its working because I added finish(); at the end of the onListItemClick() method. This would cause the activity to close after I finish running everything inside the method. Helps me immediately see if the phone’s language was changed. Such good and happy news! I could finally work on rewriting the code now. Will make a separate class to change the language and use intents to access it. Should make it better for when I start to work on the widgets. TIME TO SLEEP!

Read Full Post »


Did some error checking today and realized I was mistaken. I wasn’t finished with the first part.

It appeared to change the locale, but I was stupid to not close the app and look at the rest of the system. Turns out it only changed the language on an application level. The only thing that was changed was my app, not the entire system.

Silly beginner mistake! I should have realized that it shouldn’t have been so simple. However, changing the locale for an application alone could be useful later on. I’ll have to keep what I did in mind. Might come in handy for any future ideas.

For now, just for future reference’s purposes… to change the application’s language is putting

Locale locale = new Locale(“The Language Code: ‘en’ or ‘en, us'”);
Configuration config = new Configuration();
config.locale = locale;
getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());

Well, I guess it’s a good thing to go through that experience.
经一时,长一智: famous Chinese phrase which means something equivalent to getting wiser after going through experiences.

Going tennis tomorrow, hopefully the fresh air and exercise will help me think clearly.

Read Full Post »

Well, good news is… I’ve made progress.

Surprisingly, there’s a few things I never knew I would bump into until I actually started to write the code.

For example, I planned to recreate the Languages Selection activity and planned to use a ListActivity to do so. However, no matter what I did, the app would Force Close. This was definitely a problem, and I spent hours trying to fix up the code wondering what went wrong. Finally, I ditched that idea and just used the normal Activity. A few hours later, I went back to read the documentation on ListActivity to find out what my problem was. Apparently, to use ListActivity we MUST have  android:id=”@android:id/list”  inside the ListView of the xml file.

I experienced a few other minor problems along the way, but as of now, I’ve definitely made progress. The main screen is finished and basic functionality does work. I guess I’m successful in recreating the Language Selection activity to change the system’s language. Next step is to organize my code and refine it in a way for me to implement the other parts more easier.

This is definitely NOTHING like writing a code for a class assignment.

Read Full Post »

First Project

Going to start my first project today.
I chose to do something very very simple and its more of a project for my dad’s phone rather than for myself.

You see, my dad can only use the phone with a different language than English and I can only use it with English. Constantly switching between languages is quite a hassle and there’s a bit of trouble if he wanted to change it but was unable to navigate back to the Language setting.

Therefore, I’ve decided to develop an app that should quickly open up all available locales for the phone for easy access and also be able to create widgets for even easier switching.

Since this is a first project, I’m going to need to do a few modifications over and over again, until I’m satisfied with how it should go. But at the moment, I got the basic idea down.

Now, time to work on implementing that idea!

Read Full Post »

Hello World!

DevJackey’s Development Blog is now active!

Read Full Post »