I have a fledgling app under develop开发者_如何学Cment, which I am installing to my Android phone via Eclipse debugging.
Now, my app is only 200KB in size at the moment, but it runs very slowly. I have a button in my first activity that drops 4 SQLite tables, with a combined total of no more than 25 records, and then recreates the tables and data straight away. To my mind, this should be a pretty damn fast operation, but it takes a good 4 or 5 seconds.
There isn't anything else going on at that moment in time, netiher in the app, or on my phone. I just can't understand how it can be so sluggish. I've even made the operation above an AsyncTask, and it's made no difference.
Also, when I go into my phone's Settings -> Manage applications, the list of all my installed apps shows that they're all "computing...". Every single other app finishes this a good 3 or 4 seconds before my tiny one stops "computing..." and displays the app size info, etc.
Could all this just be symptomatic of an app not having been installed via the Marketplace? Is it something to do with the debuggable setting in my Manifest?
I'm not ready to play around with signing and release yet, not by a long shot, so I can't test to see if that's the reason. Or can I?
I have a button in my first activity that drops 4 SQLite tables, with a combined total of no more than 25 records, and then recreates the tables and data straight away. To my mind, this should be a pretty damn fast operation, but it takes a good 4 or 5 seconds.
Writing to flash is not as consistent, speed-wise, as is writing to magnetic media. Brad Fitzpatrick, in the 2010 Google I|O conference, cited some tests he ran where writing a single byte to flash, while normally fast, could take as long as 200ms.
If you are not using transactions, things will be slower, because there is a flash write and sync on every database operation.
Beyond that, it is difficult to provide you with advice, particularly with no code to examine.
I'm not ready to play around with signing and release yet, not by a long shot, so I can't test to see if that's the reason. Or can I?
Well, you can certainly sign it. For release testing, you can put the app on a Web server somewhere that is set up with the proper MIME type (application/vnd.android.package-archive
), or send it to your device via Dropbox, or something.
精彩评论