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

Difference Between native Android and ANE

Participant ,
Sep 10, 2012 Sep 10, 2012

I'm trying to build an ANE that will display the native MediaPlayer object on top of my Flex Mobile app. So far, I have successfully done it. The issue is that it won't show up until after the app state changes (most easily by turning the screen off and back on). I was able to create a MediaPlayer in a native Android app using the exact same method (in this case, using a button to delay the creation). and it works exactly as it should.

It would be great if someone knew why this was happening (it seems to be isolated to SurfaceView and VideoView), but I would really like to know what the difference is between the AIR app and the Native App. I was under the impression that the AIR app was just a single Activity class that acted as a container of sorts for the AIR app. Is this not the case? The getActivity() from FREContext seems to provide a completely valid activity, yet there seems to be little issues all over the place with interacting with that activity and a great deal many things it does not like to do.

Could anyone explain the differences please?

TOPICS
Development
2.1K
Translate
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
Enthusiast ,
Sep 11, 2012 Sep 11, 2012

AIR is like the Java Virtual Machine,  is a program runing on your device natively, but an app Runing on AIR is no a native App.

Translate
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
Participant ,
Sep 11, 2012 Sep 11, 2012

That is what I assumed. The resulting app is, in Android's case, a single Activity that runs as a window to the AIR app. What I'd like to figure out is why modifying that Activity using native Java is different than using a native app. I'm not modifying the AIR app itself, just the activity the AIR app is using.

Translate
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 ,
Oct 02, 2012 Oct 02, 2012

I've got exactly the same problem : did you found a solution ?

If I observe the view hierarchy created after adding a VideoView, I get :

android.widget.FrameLayout

|-android.widget.FrameLayout (a different one)

   |-com.adobe.AIRWindowSurfaceView

   |-android.widget.VideoView

I tried a lot of things : invalidating the views on Java side, refreshing on Actionscript side, bringing the VideoView to front in Java code ... But nothing works : when the VideoView is starting, the sound begins but the VideoView seems to be behind the AirWidnowSurfaceView until I perform a standby.

I've tried to place the VideoView just above the root FrameLayout, but it changed nothing.

According to his name, I think AIRWindowSurfaceView is derivating from SurfaceView so I can't add any child.

More ideas ?

Regards

Translate
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
Participant ,
Oct 02, 2012 Oct 02, 2012

I spent three days trying to fix that very issue. Ended up having to call it quits and move on to another idea to fix Android video. That's about all I can offer you. Sorry.

Translate
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 ,
Oct 04, 2012 Oct 04, 2012

I finally found the right solution this morning and my native VideoView is shown as soon as the ANE call is returning, and the VideoView can be managed as wanted, and now I can play H264 mp4 and HLS more easily.

Translate
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
Participant ,
Oct 04, 2012 Oct 04, 2012

How were you able to do it?

Translate
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 ,
Oct 04, 2012 Oct 04, 2012

I created a native implementation function in Java to create a VideoView. In this function I get the first child of the android.R.id.content view :




FrameLayout root = (FrameLayout)act.getWindow().getDecorView().findViewById(android.R.id.content);



ret = (FrameLayout)root.getChildAt(0);

It should be a FrameLayout containing a com.adobe.AIRWindowSurfaceView.

I call setZOrderOnTop(true) on this VideoView, then I add my VideoView to the FrameLayout.

I set FrameLayout.LayoutParameters to define the size and position of the video.

It's the first implementation I described in my initial post and which didn't not work. I just added the setZOrderOnTop(true) in place of my initial bringToFront().

Translate
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 ,
Jun 06, 2013 Jun 06, 2013

can you show us your code?

Translate
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 ,
Jun 06, 2013 Jun 06, 2013
LATEST

i want to ask u another question,if u jump from the flex to ane,would it be slow?

if u return from the ane to flex,and than go back to ane,would the activity recreate or keep?

Translate
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