android - no internet?

14 replies [Last post]
mitchellthomas
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 27 Apr 2010

According the to 2.0BetaGuide.pdf that came with beta5:

However, the following items are not yet implemented for Android:
• Orientation events • Camera • Network • Multiline text fields • Text input with keyboard • Webpopups

1. Regarding "Network": Does this mean I cannot download images/data from an internet source - for instance if I wanted to create an RSS reader?

2. "Multiline text fields" - does this include the native.newTextBox as described in the API?

Replies

myfogview
User offline. Last seen 10 weeks 1 day ago. Offline
Joined: 14 Apr 2010

I don't develop for Android but here is my understanding of the limitations.

1. I believe the internal LuaSocket library can be used to access the internet.

2. The "native." functions are only for the iPhone/iPad and not for Android. This includes keyboard, webpopups and TextBox.

Tom

myfogview
User offline. Last seen 10 weeks 1 day ago. Offline
Joined: 14 Apr 2010

From reading the Beta 5 docs it looks like Android may not support network/internet access. Can someone confirm that?

Tom

mitchellthomas
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 27 Apr 2010

That would explain why the image download sample application doesn't work on my Droid, but if that is the case then it severly limits the usefulness of creating anything in corona.

Eric
User offline. Last seen 1 year 23 weeks ago. Offline
Joined: 23 Jun 2009

The relatively completely list of what is not implemented in Android is in the beta guide:

http://developer.anscamobile.com/demo/2.0BetaGuide.pdf

Network support is indeed not yet implemented. It's difficult because Android doesn't support much in their NDK. We're considering implementing separate http functionality for this (and to allow non-blocking wait on network).

mitchellthomas
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 27 Apr 2010

Thanks for the info Eric. When do you think a decision would be made regarding implementation of http functionality? Seems like this would be a key component of a majority of mobile apps; along with a more robust text engine (i.e. multiline textfields, and formatting options). I work at an internet media company, so every app/game I create would require http functionality at a minimum.

Eric
User offline. Last seen 1 year 23 weeks ago. Offline
Joined: 23 Jun 2009

The highest priority items for Android are:

- Critical bugs
- Native text
- Webpopup
- Network
- Performance

... not necessarily in that order. These will definitely be implemented, as soon as possible.

Eric
User offline. Last seen 1 year 23 weeks ago. Offline
Joined: 23 Jun 2009

Please note that Corona SDK beta 6 adds luasocket support.

secure411dotorg
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 13 Oct 2010

My socket app works fine in the droid simulator.

Non internet apps I build work find on my DroidX.

My socket app does not state that it will be using the internet when installed - in fact it just says:

Allow this application to:
- Hardware controls
control vibrator

If it was able to access the internet it would ask about that as well.

Where can I get this "beta 6"?

secure411dotorg
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 13 Oct 2010

Sigh... I see we are way past beta 6. I have Version 2.0.0 (2010.9.16.148)

MikeHart
User offline. Last seen 5 weeks 6 days ago. Offline
Joined: 22 Mar 2010

Hi,

you have to activate the internet access inside your build.settings file.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
-- build.settings
 
settings =
{
    android =
    {
         versionCode = "1"
    },
    
    androidPermissions =
    {
         "android.permission.ACCESS_FINE_LOCATION",
         "android.permission.INTERNET",
         "android.permission.SET_ORIENTATION"
    },
    orientation =
        {
                 default = "portrait", 
                 content = "portrait",
                 supported = 
                 { 
                 "portrait", "portraitUpsideDown", 
                 }, 
        },
}

Cheers
Michael Hartlef

http://www.whiteskygames.com
http://www.twitter.com/mhartlef

secure411dotorg
User offline. Last seen 1 year 11 weeks ago. Offline
Joined: 13 Oct 2010

Thanks Mike - that solved my problem and was nice to wake up to a solution!

It would likely be helpful to new users to make this more clear in the getting started or online reference / online docs.

I had to create a build.settings file as there wasn't one for Hello World and other apps I built or studied. I found the one in the Network sample tho and used that.

MikeHart
User offline. Last seen 5 weeks 6 days ago. Offline
Joined: 22 Mar 2010

No problem. I nice that my suggestion was helping you.

Tim
User offline. Last seen 1 year 5 weeks ago. Offline
Alumni
Joined: 12 Aug 2010

@secure411dotorg, I updated the documentation with the build.settings information. Sorry for the confusion. And thanks Mike, for helping out.

http://developer.anscamobile.com/content/network#Enabling_network_access_on_Android

Tim

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.