Building apk problem

Hello All.

Here is my build.settings

settings =  
{  
android =  
 {  
 versionCode = "1" // even uses 3 still fail.  
 },  
  
 androidPermissions =  
 {  
 "android.permission.ACCESS\_FINE\_LOCATION",  
 "android.permission.INTERNET"  
 },  
  
 orientation =  
 {  
 default = "portrait"  
 }  
}  

config.lua

application =  
{  
 content =  
 {  
 width = 320,  
 height = 480,  
 scale = "zoomEven"  
 },  
}  

my build settings

After installed on HTC Desire alway crushed after 2-3 seconds…
I’ve tried sdk 2.0.1 and sdk 2.2 both failed.
What can I do? Did I set something wrong?

BTW, build for XCode Simulator works fine.

Thanks first for your help.

Erin
[import]uid: 5377 topic_id: 4370 reply_id: 304370[/import]

There’s nothing in your config or build settings that should cause a crash. Does it occur after performing some action in your app (like scrolling or selecting an item) or does it happen “by itself” so to speak? If you have the Android SDK installed on your system, you can view crash output by connecting the device via USB opening a Terminal window and typing

cd /android-sdk-mac_86/tools/adb logcat[/code]Then launch your app on the device and see what information is displayed in the terminal during the crash.Tim [import]uid: 8196 topic_id: 4370 reply_id: 13651[/import]

Thanks Tim,

I found the problem was I tried to limit the text width with “…” at the end.
I have no idea how to do it appropriate in Lua.
So I use a loop to check labelText.contentWidth when added a char every time.
That’ why crashed in Android version.

Do you have any official ui component about limit Label width “…” when over a specific width?

Thanks for your hand.

Erin

[import]uid: 5377 topic_id: 4370 reply_id: 13654[/import]

And I also found a problem about “Back key” in Android Device.

How can I make it work on my Corona-Android project?
I dont want to exit app while every time click it.

Thanks first for you help.

Erin
[import]uid: 5377 topic_id: 4370 reply_id: 13655[/import]

Erin,

Could you share your string truncation code that was causing the crash? Your approach sounds reasonable, so I’m curious why it would crash.

Currently, you can’t “trap” the back key on Android apps. I added a feature request for this (internal bug #2453).

Tim [import]uid: 8196 topic_id: 4370 reply_id: 13666[/import]

I added some code below in ui.newLabel( the old ui component from previous version ) function…
coz I don’t know how to count the width by #string when double-byte character and English in same string…

labelText = display.newText( "", 0, 0, font, size )  
local over = false  
for k = 1, #s do  
 labelText.text = string.sub(s, 1 , k);  
 if (labelText.width \>= width) then  
 over = true  
 break  
 end  
end  
if over then labelText.text = labelText.text.."..." end  

[import]uid: 5377 topic_id: 4370 reply_id: 13669[/import]

And I found another bug of Android version.
I builded the ListView from your Sample Code.
I found there is no button down reaction while I click the ListView app on my HTC Desire…
I mean the button down blue background view.

Erin [import]uid: 5377 topic_id: 4370 reply_id: 13670[/import]