• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

DatagramSocket on mobile AIR 3.8

New Here ,
May 14, 2013 May 14, 2013

Copy link to clipboard

Copied

I've created a really basic project to test the DatagramSocket in AIR 3.8 & Flash Player 11.8, but the DatagramSocket.isSupported property is coming back as false...even though Adobe says it is supported on Android & iOS.

Another new feature is ServerSocket, when I trace that out it comes back as true. Has anyone had trouble using this?

Capabilities.version = IOS 11,8,800,49

NativeApplication.nativeApplication.runtimeVersion = 3.8.0.440

DatagramSocket.isSupported = false
ServerSocket.isSupported = true

TOPICS
Air beta

Views

3.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 14, 2013 May 14, 2013

Copy link to clipboard

Copied

You need to be on 21 swf version, please set -swf-version=21 in your compiler options.

-Pahup

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

Hi Pahup,

Thanks for you reply. I've tried adding that compiler argument but it didn't fix it. What confuses me is that I'm seeing 11.8.800.49 when I trace out the player version...isn't that correct for -swf-version=21?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

And how about the namespace of your AIR application, is it 3.8?

-Pahup

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

Yes that's also correct;

<application xmlns="http://ns.adobe.com/air/application/3.8">

It's weird that one new 3.8 feature (ServerSocket) works, but another (DatagramSocket) doesn't. Have you tried making an ActionScript Mobile Project which targets AIR 3.8 and trace out DatagramSocket.isSupported? I would be interested if the same happens to you.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

If I create a release build and put it on my iPhone, DatagramSocket isn't unsupported. But if I create a debug version using exactly the same code and put that on my iPhone...DatagramSocket IS supported. I'm confused. Do I need to change some permissions in the XML descriptor?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

Right, so I've gone the whole way and created a release build with 'UIRequiresPersistentWIFI' set to true in the descriptior XML and that seems to work when I create a release build. But if I run a debug build in Flash Builder I get isSupported=false again.

At least I know it works on the device with this setting turned on but that makes it impossible to develop with as I really don't want to create and deploy a release build to my phone every time I want to test the smallest changes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

Could you please check and share the swf version used for both release and debug build you used. The easiest way to identify the swf version is by using swfdump-cli.jar available as the part of the SDK.

java -jar AIRSDK/lib/swfdump-cli.jar mySwf.swf

-Nimit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2013 May 17, 2013

Copy link to clipboard

Copied

Hi Nimit,

I've never used that  before. How do I use it?

*edit* I'm using a Mac by the way, if that makes a difference.

Lewis

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 17, 2013 May 17, 2013

Copy link to clipboard

Copied

Please use the following command on the terminal : java -jar AIRSDK/lib/swfdump-cli.jar mySwf.swf ,  the command will work on both win/mac.

-Nimit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 17, 2013 May 17, 2013

Copy link to clipboard

Copied

Ok thanks, I will try that and post the results. Out of interest, are you seeing the same issue?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 17, 2013 May 17, 2013

Copy link to clipboard

Copied

No, it's working fine with both release and debug build.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 18, 2013 May 18, 2013

Copy link to clipboard

Copied

Ok, so I just created a blank ActionScript Mobile project, targeted the AIR 3.8 SDK, made sure my descriptor XML has 3.8 namespace, added "-swf-version=21" into the compiler options, compiled a debug build and traced out a few values.

Capabilities Version IOS 11,8,800,49

Runtime Version 3.8.0.440

DatagramSocket.isSupported false

Here is the SWF dump

Adobe SWF Dump Utility

Version 2.0.0 build 353900

Copyright 2003-2012 Adobe Systems Incorporated. All rights reserved.

<?xml version="1.0" encoding="UTF-8"?>

<!-- Parsing swf file:/Volumes/LaCie/Projects/Flash Builder/DatagramSocketTest/bin-debug/DatagramSocketTest.swf -->

<swf xmlns="http://macromedia/2003/swfx" version="21" framerate="24.0" size="10000x7500" compressed="false" >

  <!-- framecount=1 length=1404 -->

  <FileAttributes useDirectBlit="false" useGPU="false" hasMetadata="true" actionScript3="true" suppressCrossDomainCaching="false" swfRelativeUrls="false" useNetwork="true"/>

  <Metadata>

        <![CDATA[<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'><rdf:Description rdf:about='' xmlns:dc='http://purl.org/dc/elements/1.1'><dc:format>application/x-shockwave-flash</dc:format><dc:title>Adobe ActionScript Application</dc:title><dc:description></dc:description><dc:publisher>unknown</dc:publisher><dc:creator>unknown</dc:creator><dc:language>EN</dc:language><dc:date>May 18, 2013</dc:date></rdf:Description></rdf:RDF>

]]>

  </Metadata>

  <EnableDebugger2 password="NO-PASSWORD" reserved="0x1975"/>

  <!-- unknown tag=63 length=16 -->

  <ScriptLimits scriptRecursionLimit="1000" scriptTimeLimit="60"/>

  <SetBackgroundColor color="#FFFFFF"/>

  <ProductInfo product="FLEX" edition="NONE" version="4.6" build="23201" compileDate="5/18/13 2:34 PM"/>

  <FrameLabel label="DatagramSocketTest"/>

  <DoABC name="DatagramSocketTest"/>

  <SymbolClass>

    <Symbol idref="0" className="DatagramSocketTest" />

  </SymbolClass>

  <ShowFrame/>

</swf>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 21, 2013 May 21, 2013

Copy link to clipboard

Copied

Thanks lewi-p for your help, the bug is reproducible with ADL, should be fixed in next week's 3.8 labs build.

-Pahup

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 21, 2013 May 21, 2013

Copy link to clipboard

Copied

LATEST

Ah cool, so I wasn't going crazy...that's a relief haha Thanks for your help guys, I look forward to the new build.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines