Hello, I come to ask only for a few tips or merely a bit of guidance on my development for Android.
I'm pretty skilled in ActionScript and new to Java. In this thread I ask how would I do some things in Java, providing the equivalent in AS.
I intend to draw shapes on screen and use them as UI - as a deeper layer within the Android XML UI.
In ActionScript, I can create Sprites or DisplayObjects, edit their "graphics" property like
// create a DisplayObject instance
_someDisplayObject = new DisplayObject();
// create a white square inside it
_someDisplayObject.graphics.beginFill(0xFFFFFF);
_someDisplayObject.graphics.drawRect(0,0,100,100);
_someDisplayObject.graphics.endFill();
// place it dinamically in a position relative to the Stage (canvas)
_someDisplayObject.x. = Stage.stageWidth / 2;
------------------
Also, are there Tweening libraries like TweenLite or Tweener ? Those which allows to create animation with one like of code like:
// move display object to position X = 300 with half transparency, in half second
Tweener.addTween(_someDisplayObject, { x:300, alpha:0.5, time:0.5, transition"EaseOutSine" } );
------------------
Can anyone give a clue, on what am I looking at, to try the same in Java for Android ?
Just an advice letting me know where to start would be greatly appreciated. :fingers-crossed:
Thank you !
You can create shapes in Android using XML or in your Java code or with both. You can also create Animations including Tween animations. (I haven't used animations before though so I can't help any further).
The first place to go is the Android Developers website (d.android.com/develop) and then in the API Guides section under User Interface option and App Resources option in the left hand menu. There are samples included in the Android SDK under API Demos which you can use to get your started.
I can't post links because I haven't made 10 posts yet, sorry.
As you already know, the Android display model is more complex than the one used in ActionScript.
There is no direct equivalent for the graphics property from AS3 in Android.
To draw low-level graphics you can use the canvas parameter provided in the onDraw method (you override it in your own class inherited from android.view.View).
As for the Tweening, like Kavrocks said, try to learn how to use the Animation class and it's extensions, because they are built inside the android framework, therefore optimized (that's just my opinion). All the tweening engines in AS3 are based on dynamic calling of properties (by name). Java uses the reflection api for calling dynamic properties, but it is much slower than a direct call (from a specialized Animation class, in this case).
I am also trying to figure out different modes of applying animations and effects in actionscript. There's a tutorial on Lynda where you can see som tips from migrating from AS to Java, and HTML5, both of this can help you understand better how to apply them in your application.
Hi,
I am new to android app development, and working on some kind of augmented reality app.
Requirement is user open the camera and should be able to overlay product images(ring, tshirt, etc..) on top of it.
Must support multiple image overlays too, all the images should be moveable across the camera feed, resizeable, rotatable using two fingers and should capture the overlay images along with the camera feed too.
Can some one help me with an example containing code and respective layouts.
thanks in advance
Hi,
I am new to android. I am working in an application which uses camera intent to take pictures, and the preview is shown in another layout.
Now i need put multiple images on to it. Images should be re-sizable and movable across the screen and finally need to take a snap shot of it.
Right now i tried to create an imageview dynamically at the runtime using Layout inflator to overlay the image but could not able to do this multiple times.
Could any one give some suggestion or idea how to do it.
Hi,
I am new to android app development, and working on some kind of augmented reality app.
Requirement is user open the camera and should be able to overlay product images(ring, tshirt, etc..) on top of it.
Must support multiple image overlays too, all the images should be moveable across the camera feed, resizeable, rotatable using two fingers and should capture the overlay images along with the camera feed too.
Can some one help me with an example containing code and respective layouts.
thanks in advance
Does anyone know if there already is a camera app out there which basically allows you to select an image from the gallery, set the transparency and it acts like an "onion skin" (transparent layer, like when you do animations)? Example: http://img-ipad.lisisoft.com/img/1/9/1907-2-overlay-camera-lite.jpg
The purpose for this will be for example copying a face expression and angle as precisely as possible, for later replacing in animated gifs (face swaps basically). It's really hard to look at an image on the computer and trying to take a selfie that's exactly the same expression and angle without a camera function like this.
If there isn't such a camera out there, anyone willing to make such an app? I'm sure it will be appreciated by the masses for a wide range of uses (like regular stop motion animation and such)