MapView in Android

I have an app that is currently working as intended on iOS devices but when I test it in my Android devices it triggers an error when I call for a new mapview.

I have set these permissions in my build settings:
“android.permission.ACCESS_FINE_LOCATION”,
“android.permission.ACCESS_COARSE_LOCATION”,
“android.permission.INTERNET”

And I’m currently building using debug settings.

Should I try to build it with a release signature or something like that? Am I missing a step?

Thanks!

[import]uid: 151732 topic_id: 32067 reply_id: 332067[/import]

guilovsh,

The current release version of Corona (build #894) does not support map views on Android. We recently added support for it in our daily builds (think beta versions), which are only available to paid subscribers. [import]uid: 32256 topic_id: 32067 reply_id: 127834[/import]

Yeah. It isn’t working at all.

Do you have any idea when will there be a release of Corona with working mapviews in Android, Joshua?

Thanks for your attention. [import]uid: 151732 topic_id: 32067 reply_id: 127838[/import]

No release date yet. We’ll decide on a release date after Apple’s big announcement next week… just in case we need to add support for a new device at the last minute.

Or… you can purchase a subscription and get map support on Android now. :slight_smile: [import]uid: 32256 topic_id: 32067 reply_id: 127852[/import]

And are these daily builds stable enough to be used to build and release an app or you usually recommend subscribers to stick to the release build when building a definitive version?

I’m probably going to purchase a subscription really soon, I just want to be sure my app is as finished as possible before buying it.

Another question ( I can open a new thread if you don’t want to use this one):
I’m testing my app in a galaxy tab 2 with Android 4.0 and my app adapts to the device orientation and I’m having some troubles figuring how to solve a little problem.

Once my app starts viewableContentHeight and width are set excluding Android status bar height(which is perfect and correct), but when I change my device orientation these values should be updated in such a way that the status bar height keeps diminishing current height value, but apparently viewableContentWidth and viewableContentHeight are simply switched.

Is there anyway I can force Corona to update these display values correctly?

Thanks again for your attention. [import]uid: 151732 topic_id: 32067 reply_id: 127853[/import]

– [import]uid: 89165 topic_id: 32067 reply_id: 127778[/import]

>> are these daily builds stable enough to be used to build and release

I would say it depends on the features that you are using. The current map view implementation that we have on Android is our first pass at it. There are 2 known bugs that need to be fixed before I would say it is release worthy. But that said, using this version is your opportunity to evaluate its functionality and provide us feedback before release. That’s the advantage of our daily builds.
Regarding the orientation change issue, that is a known bug on all Android tablets running on Android OS version 3.0 and above. The only work-around at the moment is to set up your app with a fixed orientation such as “portrait” and “portraitUpsideDown”… or “landscapeRight” and “landscapeLeft”.

We definitely recognize this as a high priority bug. Especially with the gaining popularity of Android 4.x tablets. We plan on fixing it *after* our upcoming release. The reason for the delay is that this is a bug in our core rendering code and we risk breaking things on iOS as well… and we dare not break the upcoming release with all of the needed iOS 6 changes in it. We plan on addressing this issue sometime in November. [import]uid: 32256 topic_id: 32067 reply_id: 127936[/import]

guilovsh,

The current release version of Corona (build #894) does not support map views on Android. We recently added support for it in our daily builds (think beta versions), which are only available to paid subscribers. [import]uid: 32256 topic_id: 32067 reply_id: 127834[/import]

Yeah. It isn’t working at all.

Do you have any idea when will there be a release of Corona with working mapviews in Android, Joshua?

Thanks for your attention. [import]uid: 151732 topic_id: 32067 reply_id: 127838[/import]

No release date yet. We’ll decide on a release date after Apple’s big announcement next week… just in case we need to add support for a new device at the last minute.

Or… you can purchase a subscription and get map support on Android now. :slight_smile: [import]uid: 32256 topic_id: 32067 reply_id: 127852[/import]

And are these daily builds stable enough to be used to build and release an app or you usually recommend subscribers to stick to the release build when building a definitive version?

I’m probably going to purchase a subscription really soon, I just want to be sure my app is as finished as possible before buying it.

Another question ( I can open a new thread if you don’t want to use this one):
I’m testing my app in a galaxy tab 2 with Android 4.0 and my app adapts to the device orientation and I’m having some troubles figuring how to solve a little problem.

Once my app starts viewableContentHeight and width are set excluding Android status bar height(which is perfect and correct), but when I change my device orientation these values should be updated in such a way that the status bar height keeps diminishing current height value, but apparently viewableContentWidth and viewableContentHeight are simply switched.

Is there anyway I can force Corona to update these display values correctly?

Thanks again for your attention. [import]uid: 151732 topic_id: 32067 reply_id: 127853[/import]

– [import]uid: 89165 topic_id: 32067 reply_id: 127778[/import]

>> are these daily builds stable enough to be used to build and release

I would say it depends on the features that you are using. The current map view implementation that we have on Android is our first pass at it. There are 2 known bugs that need to be fixed before I would say it is release worthy. But that said, using this version is your opportunity to evaluate its functionality and provide us feedback before release. That’s the advantage of our daily builds.
Regarding the orientation change issue, that is a known bug on all Android tablets running on Android OS version 3.0 and above. The only work-around at the moment is to set up your app with a fixed orientation such as “portrait” and “portraitUpsideDown”… or “landscapeRight” and “landscapeLeft”.

We definitely recognize this as a high priority bug. Especially with the gaining popularity of Android 4.x tablets. We plan on fixing it *after* our upcoming release. The reason for the delay is that this is a bug in our core rendering code and we risk breaking things on iOS as well… and we dare not break the upcoming release with all of the needed iOS 6 changes in it. We plan on addressing this issue sometime in November. [import]uid: 32256 topic_id: 32067 reply_id: 127936[/import]

I just subscribed to Corona, got a daily build and tried to build my app using it.

Now MapViews seem to be working but they aren’t positioned correctly, dimensioned correctly and I wasn’t able to “pinch-zoom” using a galaxy ace plus (though it did work in a galaxy s3)

Is there anywhere I can find which bugs are already known of?
[import]uid: 151732 topic_id: 32067 reply_id: 129358[/import]

Pinch zooms are not supported on Android 2.2 and 2.3 devices. So, we display +/- zoom buttons on the map instead. Notice that the zoom buttons are not shown on newer Android OS versions which do support pinch zooms. This is by design. We do this to work-around a limitation on older Android OS versions. It would be nice to support pinch zooms on the older OSes too, but we would have to implement it ourselves which would be a lot of work that we’re not prepared to do yet. [import]uid: 32256 topic_id: 32067 reply_id: 129390[/import]

I just subscribed to Corona, got a daily build and tried to build my app using it.

Now MapViews seem to be working but they aren’t positioned correctly, dimensioned correctly and I wasn’t able to “pinch-zoom” using a galaxy ace plus (though it did work in a galaxy s3)

Is there anywhere I can find which bugs are already known of?
[import]uid: 151732 topic_id: 32067 reply_id: 129358[/import]

I’m really hoping those 2 android map bugs Joshua referred to (“There are 2 known bugs that need to be fixed before I would say it is release worthy”) are the android map Battery Drain bug, and the android 4.0 and android 4.1 map display/drawing bugs (seen on the s3 and nexus 7).

IMHO, once those 2 are fixed, I think it’s ready for Android prime time. (And if you’re a pessimist: the android maps are crippled until then).

NOTE: The Android 4.0, 4.1 bugs that present themselves on the S3 and Nexus 7 were reproduced with the following code:

[code]
– Note on Android 4.0 and 4.1 systems, various map glitches are apparent if you move the map around.

– On Android 4.0 systems (seen on the S3), white map areas can be seen on the map…
– This appears to be some interim buffer/clipping issue during the map rendering.
– On Android 4.1 systems (seen on the Nexus 7), moving the map causes the rest of the screen
– to go black, and again, perhaps some type of buffering error during map rendering to the display.

– Following code was adapted from CoronaLabs mapView example code

– Create a native MapView (requires XCode Simulator build or device build)
– You can create multiple maps, if you like…

myMap = native.newMapView( 0, 0, 300, 400 )
myMap.mapType = “standard” – other mapType options are “satellite” or “hybrid”

– The MapView is just another Corona display object, and can be moved or rotated, etc.
myMap.x = display.contentWidth / 2
myMap.y = display.contentHeight / 2

– Initialize map to a real location, since default location (0,0) is not very interesting
local currentLatitude = 37.331692
local currentLongitude = -122.030456

myMap:setCenter( currentLatitude, currentLongitude )

local function callMap()

myMap:addMarker( tonumber(currentLatitude), tonumber(currentLongitude), { title=“Bugs seen on S3 and Nexus 7”, subtitle=“Render buffering/clipping issues…”} )

end

– Show a little text… mapView will overdraw it on Nexus 7 / Jelly Bean
local Title = display.newText( “Android 4.0, 4.1 mapView test”, 10, 50, native.systemFont, 30 , { 255, 255, 255, 255 })
Title:setReferencePoint(display.TopLeftReferencePoint)
Title:setTextColor( 255, 255, 255, 255 )
Title:setTextColor(255,255,255)

timer.performWithDelay( 1000, callMap ) – get current location after 1 second
[/code] [import]uid: 79933 topic_id: 32067 reply_id: 129420[/import]

Pinch zooms are not supported on Android 2.2 and 2.3 devices. So, we display +/- zoom buttons on the map instead. Notice that the zoom buttons are not shown on newer Android OS versions which do support pinch zooms. This is by design. We do this to work-around a limitation on older Android OS versions. It would be nice to support pinch zooms on the older OSes too, but we would have to implement it ourselves which would be a lot of work that we’re not prepared to do yet. [import]uid: 32256 topic_id: 32067 reply_id: 129390[/import]

I’m really hoping those 2 android map bugs Joshua referred to (“There are 2 known bugs that need to be fixed before I would say it is release worthy”) are the android map Battery Drain bug, and the android 4.0 and android 4.1 map display/drawing bugs (seen on the s3 and nexus 7).

IMHO, once those 2 are fixed, I think it’s ready for Android prime time. (And if you’re a pessimist: the android maps are crippled until then).

NOTE: The Android 4.0, 4.1 bugs that present themselves on the S3 and Nexus 7 were reproduced with the following code:

[code]
– Note on Android 4.0 and 4.1 systems, various map glitches are apparent if you move the map around.

– On Android 4.0 systems (seen on the S3), white map areas can be seen on the map…
– This appears to be some interim buffer/clipping issue during the map rendering.
– On Android 4.1 systems (seen on the Nexus 7), moving the map causes the rest of the screen
– to go black, and again, perhaps some type of buffering error during map rendering to the display.

– Following code was adapted from CoronaLabs mapView example code

– Create a native MapView (requires XCode Simulator build or device build)
– You can create multiple maps, if you like…

myMap = native.newMapView( 0, 0, 300, 400 )
myMap.mapType = “standard” – other mapType options are “satellite” or “hybrid”

– The MapView is just another Corona display object, and can be moved or rotated, etc.
myMap.x = display.contentWidth / 2
myMap.y = display.contentHeight / 2

– Initialize map to a real location, since default location (0,0) is not very interesting
local currentLatitude = 37.331692
local currentLongitude = -122.030456

myMap:setCenter( currentLatitude, currentLongitude )

local function callMap()

myMap:addMarker( tonumber(currentLatitude), tonumber(currentLongitude), { title=“Bugs seen on S3 and Nexus 7”, subtitle=“Render buffering/clipping issues…”} )

end

– Show a little text… mapView will overdraw it on Nexus 7 / Jelly Bean
local Title = display.newText( “Android 4.0, 4.1 mapView test”, 10, 50, native.systemFont, 30 , { 255, 255, 255, 255 })
Title:setReferencePoint(display.TopLeftReferencePoint)
Title:setTextColor( 255, 255, 255, 255 )
Title:setTextColor(255,255,255)

timer.performWithDelay( 1000, callMap ) – get current location after 1 second
[/code] [import]uid: 79933 topic_id: 32067 reply_id: 129420[/import]

Everyone,

The MapView GPS issue has now been fixed as of daily build #947.

The MapView rendering issues have just been fixed today and the fix will be made available in a daily build later this week.
[import]uid: 32256 topic_id: 32067 reply_id: 130390[/import]