Sunday, November 4, 2012

Hardcoded string should use @string resource

Android Development Solution - use @String Resource

Android development Solution
Problem : I'm a beginner android developer , I was trying to run this Linear Layout in eclipse :
Code :
And, I noticed :
1) yellow line under android:text="Yellow"
2) yellow line under android:text="row four"
the Triangle warn says [I18N] Hardcoded string "Yellow", should use @string resource " and same for the rest of the warnings.Any suggestion?


Solution :

It is not good practice to hard code strings into your layout files. You should add them to a string resource file and then reference them from your layout.

This allows you to update every occurrence of the word "Yellow" in all layouts at the same time by just editing your strings.xml file.

It is also extremely useful for supporting multiple languages as a separate strings.xml file can be used for each supported language.



More Android articles :

Wednesday, September 26, 2012

Android games : Cryptic Kingdoms HD Cheat Page 5

Previous

51. Go back to the three doors. Take the right door to the Mausoleum. Look at the door, then change the color of the flower on each dial to match the door. Also rotate the white symbol to point to the color of the corresponding symbol. If you get it right, the Mausoleum door will open.




52. Enter the Mausoleum. Take the Hammer and the Star Relic and note the clue:
53. Go back to the three doors and take the left door to the Courtyard. Use the three clues we found to solve the puzzle. The star is I, the leaf is II and the bird is III. Solve the puzzle and you’ll get the Moon Relic.





54. Go back to the Exhibit Room. Use the Hammer to break the vase on the table and get the Talisman.

55. Go to the Symbol Room and tap on the globe. Place the Talisman in the slot and a symbol will appear below it. You can change it to any of the three relics by tapping on it. Choose one and then go back and look at the wall above the globe. One of the pieces will have moved to reveal the symbol of the relic. Place the relic in that spot and go back and change the symbol on the globe to another one. Do the same for all three and you’ll get the Shard of Spirit.



56. Go back to the Mausoleum. Take the Key of Honour. Tap on the glowing white box. Tap on it again and you’ll teleport back to the mushrooms.


57. Place the Shard of Spirit where you placed the Shard of Strength (near the Honour Gateway).

58. Go to the Honour Gateway and use the key on it.

59. Enter the Honour Gateway and continue on through the Great Entrance to the Temple. Here you’ll see a puzzle with two dragon statues.
Like the previous puzzles, look at the colors of the dragons. You can change the color by going up to the scroll and taping the scroll to generate dots. On the left scroll it can either be none, one, two, or three in a vertical column. You can go up to the right scroll and tap on it to be another series of combinations. With either scroll, when you back up, you will see that the dragon color has changed. This is the method of changing both the left and right dragon colors.
Then, take a look at the center left stack of three blocks. Each block has a left and right color AND a symbol.
Then you go to the rotating wheel and see how many dots represent each symbol. This will be useful later but not right now.

So, we go back to the column and start with the top block. Blue on the left and yellow on the right with a symbol in the middle. Back up to the scroll on the left and enter a series of dots until you get a blue dragon. You then click on the dragon and an eye will light up that locks that color. You can then go back to the scroll and change the dots without changing the dragon color. You need this function in a bit. You then go over to the right scroll and click on it and back away until you get a green dragon. Again, click on the dragon to get an eye that locks the color
Then go to the stack of blocks and take note of the symbol. Go over to the rotating wheel and you will see the same symbol…. that in this case has two upper dots.
Go back to the right scroll and click on it until you get the same upper two dots. Go over to the left scroll and click on it until no dots are shown. If you back up, you will then see a blue dragon on the left and a green dragon on the right. The scroll on the right will show two upper dots.
Then go the blocks and tap on the upper block. The symbol will be highlighted!
You then repeat the same sequence on the second and third blocks, dots, and dragons. When all three symbols on the block stack are lit, a door will open and a key will appear!






Take the House Key.
60. Continue along the path to the Residence Entrance. Tap on the gong and then take the Safe Key. Then use the House Key to unlock the door and enter the house.
61. Take the Sword (katana) from the stand. Use the Safe Key to unlock the safe and take the Figurine.
62. Open the two cabinets below the safe ad take the Lantern and Umbrella.
63. Walk through the doorway to the right to enter the Shrine Room. Put the umbrella under the light to see the Shrine. Put the Figurine in the empty spot on the Shrine.
For example : Let say that all the figurines are off and the dots in the Scroll are also off, you start t any Figurine (i.e. the right-top corner) and press it, you will notice that the corresponding red light is at the bottom-left, now go to the Scroll and mark the dot that represents the the red light you have just lit on the Shrine which is (the single dot at the top-left) then back to the Shrine and hit the lit in the middle of it, you will notice that the light in the Shrine is still up though you press on another Figurine to start another one,  note that there are 2 Figurines that need 2 dots to be marked red which are the one at the top-left side and the one at the bottom-left side, when you are done you will notice that the locker in the right corner is unlocked, grab the mask and continue.

Cryptic Kingdoms HD Cheats Page 4

Previous

40. Go back to the well and attach the rope and bucket. Tap the handle until the bucket goes down into the well and comes back up with something in it. Take the Key of Spirit.

41. Enter the tunnel again. Go to the end. Using the pages from the book, solve the puzzle. The shapes should look like this to unlock the door:
42. Tap the door to open it and enter the next room. Put the Key of Spirit in the device in front of you:

43. Tap on the glowing orb and you’ll be teleported to a palace entrance. You can’t turn back.
44. Enter the palace to the Exhibit Room. If you examine the dinosaur bones, you’ll notice one bone is missing. Tap on the table to the left and take the Token of Life. You can’t pick up the vase yet.


45. Tap on the doorway to enter the Symbol Room. Tap the next doorway and take the Symbol of Devotion above the middle door.
46. Enter through the middle door. Take the ladder. Examine the elephant carving to find a clue. You can also enter the Tomb and place the tokens you have on the matching symbols on the left and right walls. Or you can do that later.



47. Go back to the Symbol Room and use the ladder on the wall to the right. Climb up and open the cabinet that’s up there to find another clue and a Fossil.

48. Go back to the Exhibit Room and put the Fossil on the dinosaur skeleton. His mouth will open, revealing the Token of Wisdom. Take it.
49. Go to the Symbols room and tap on the globe to the left of the doorway. Between it and the vase is a Token of Solace. Take it.
50. Go through the doorway and take the the middle door again. Enter the Tomb and place all the Tokens on the matching symbols on the right and left walls. You need to play with the lines to match them up to the lines on the main wall. When they’re both matched up correctly, the Earth Relic will appear in the center of the main wall.