zhxzhxustc / stardroid

Automatically exported from code.google.com/p/stardroid
0 stars 0 forks source link

Weird app/res/values/strings.xml issue #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
With the current code, everything works after building with ant clean debug.

But if I make two additions to app/res/values/strings.xml, something gets 
weirdly corrupted.

Specifically, I added license and license_title test strings close to the 
beginning as follows:

    <string name="app_name" translation_description="Application Title">Sky Map</string>
    <string name="license_title">This is a
quick test</string>
    <string name="license">This is a quick test
license</string>
    <string name="menu_settings">Settings</string>

Then some of the app data gets corrupted.  One example problem can be seen as 
follows: Menu | Gallery | Omega Centauri | Find in sky.  Result: not found!  
(In other testing, I had other results, such as its showing Omega Centauri in 
the wrong part of the sky, near the Big Dipper.)

I don't know if it's some subtle bug somewhere in the code, or something wrong 
with my build environment.

Original issue reported on code.google.com by arpruss on 22 Jan 2012 at 7:07

Attachments:

GoogleCodeExporter commented 9 years ago
Nah, its the wonky way that we handle strings.

When we generate the data for the objects, instead of storing the name with the 
data, we stores a resource ID. The names are then stored as resources. If you 
add resources, you change the resources IDs associated with the names, and the 
object names end up out of whack. To fix it, you need to regenerate the object 
data. To do that, look at 
trunk/tools/src/com/google/android/stardroid/data/README.TXT. The instructions 
there *should* do the trick, although I haven't run it in a while.

We aren't really happy with the way the data currently works. Basically, we 
create proto-buffers for all of the object data. I think we did that for 
performance reasons way back when. We can probably just stick the data in an 
SQLite database and slurp it all in at application startup. That would 
completely remove this problem.

Let me know if you have trouble regenerating the data. I can take a look and 
give you a hand.

Original comment by kevin.se...@gmail.com on 23 Jan 2012 at 11:29

GoogleCodeExporter commented 9 years ago
Ah, so there should be a comment in strings.xml that one shouldn't add or 
delete strings above where the objects are listed without regenerating, and 
then one can freely add and delete strings below that.  At least assuming the 
assignment is sequential.

Original comment by arpruss on 24 Jan 2012 at 12:37

GoogleCodeExporter commented 9 years ago
Yeah, I'd like more hints on how to build the data.  I did try running "ant 
build" in the tools directory, but I got the error: "Target 'compile' does not 
exist in the project 'Stardroid'."

In the end, in any case, I will want the data storage changed to some 
specialized format so it can be extended to have a lot more stars: 2.5 million 
stars for the Tycho 2 catalog plus a couple million more to supplement that 
will be needed to give a good approximation to what I see in the eyepiece in my 
13" telescope.  The data will need to be divided into sectors by positions and 
magnitude.

Original comment by arpruss on 24 Jan 2012 at 2:18

GoogleCodeExporter commented 9 years ago
same for me,
as soon as i include an Android Library Project everything get's messed up.
Also i'm unable to even build the tools project using "ant build" because of 
the error:
"Target 'compile' does not exist in the project 'Stardroid'."

It would be really great if you could post an explanation of how to regenerate 
the data in the wiki.

Original comment by goddc...@googlemail.com on 30 Jan 2012 at 4:55