Equivalent of wp7 pivot control on iOS and Android? [duplicate] - android

does anyone know if there is a UI widget out there for android that is like the windows phone 7 panorama or pivot controls? if not, is there any tutorial that would guide me down the right path in implementing my own?
any help is appreciated. thanks.

Yes, I was interested in the Pivot controls also.
Here's the best working resource I've found for Pivot-like functionality: http://viewpagerindicator.com/
Or, if you would like to see the official Android Developers' Guide about this, called ViewPager: http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html

Not sure I entirely get what you want, but looking at this Pivot really is just tabs: take a look at the Tab Widget tutorial. Panorama is a bit more tedious: you can try embedding the View you want to pan into a HorizontalScroller. If it is wider than the screen it will let you scroll around horizontally. To get vertical panning as well wrap that with a ScrollView.

Related

How to create infinite scrollable and zoomable view android?

I am very new to android programming, and I want to create a large infinite scrolling and zoomable activity where I can add views much like the empty activity we get in the Simple Mind app. Which layout and activity type should I use? What we the best way to implement this? Any help or pointers to tutorials are welcome.
No view in Android is infinite, you're going to run out of memory at some point. The solution you choose will depend on how interactive you need the zoomed view to be.
You can check out android pinch zoom for previous discussions on this topic.
If you're just looking at displaying information and not editing then I'd suggest custom tile maps for google maps.
https://developers.google.com/maps/documentation/android/tileoverlay
I've seen it used before for very high resolution viewing of paintings.

What is the best approach for drawing and animating images on Android

Im experienced iOS dev but new to Android dev and asking some newbie questions here...
I have to make a app where I have a background image and I then place some other images on top of that, and also onto those images I have to place different "glow" images that flicker (opacity on/off), and I need good control on positioning all those images. Now there is not some high performance goal here, and its not many objects, its not really a game.
What is the best approach for this? Can I use ImageView's for this or will it be better to use a Surface and custom draw in a thread?
And please, what ever you suggest, can you give a link to a good tutorial on the approach (ImageView or custom draw), I need all the help I can on this project with its crazy deadline.
Thank you
Søren
In my experience:
if its mostly static you should stick to XML and stuff like ImageViews etc
if its simple animations, the predefined android classes are fine and somewhat easy to use
if you want real custom then drawing with canvas is the way to go
You can extend View and override the onDraw method or create a SurfaceView which has better performance but is not that easy to use.
(sorry i dont have any tutorial links)

Best approach to develop a GPS like application

I'm new to android and I'm starting to develop a GPS like application for android, the basic concept of the app is to show up a blueprint, and display on top of it pins with information related to the position on the blueprint and other settings.
An example of this would be taking a blueprint of an apartment which you can scale and pan, and on top of it place markers with information about each part of the apartment and obviously positioned in the right places like bathrooms, bedrooms, kitchen, etc.
My question is what is the best approach to develop this kind of functionality?
My first thoughts were to use a RelativeLayout as a container, an ImageView for the blueprint with zoom and pan capabilities and individual views for the pinning with the respective place for information positioned based on the zoom and pan of the image.
Then I kept digging and saw the 2d Graphics option but I don't really know how to implemented for this.
I'll appreciate if anyone can send me in the right direction and if is possible some examples as well.
Thank you in advance.
Use a MapView with an ItemizedOverlay to display the markers. Here's a step-by-step answer how to accomplish this (See Item B of the answer).

set the origin (x,y) of a view inside of a RelativeLayout

I have some game pawns on a screen inside of a RelativeLayout. When the user clicks the pawn I would like then to be able to drag it under there finger. I have the MotionEvent captured but can't seem to find how to adjust the orion of the pawn.
I've seen posts saying to adjust the margin but that seems questionable. I still want to do hit tests for the pawns after they've been moved and don't understand how to work with the margins in that case.
thanks!
I would recommend not using a Relative Layout at all.
A Canvas is a much better option
Or if you really want to use a layout, possibly an AbsoluteLayout is a better option
Using a layout for a game may prove unsatisfactory as you proceed. I can recommend using the free and open source game engine AndeEngine for making 2D games. The problems you have with collision detection and x,y positioning are trivially easy to implement with it. I've made 2 games and a visualization view within an app with is so far.
Check it out here:http://www.andengine.org/
You can download the demo app to your android device and see its out-of-the-box capabilities. (They include Sprites, sound, animation and more.)
This one game I made with it.
https://market.android.com/details?id=com.plonzogame&hl=en

is there a panorama or pivot UI control on android similar to the ones on windows phone 7?

does anyone know if there is a UI widget out there for android that is like the windows phone 7 panorama or pivot controls? if not, is there any tutorial that would guide me down the right path in implementing my own?
any help is appreciated. thanks.
Yes, I was interested in the Pivot controls also.
Here's the best working resource I've found for Pivot-like functionality: http://viewpagerindicator.com/
Or, if you would like to see the official Android Developers' Guide about this, called ViewPager: http://developer.android.com/reference/android/support/v4/app/FragmentPagerAdapter.html
Not sure I entirely get what you want, but looking at this Pivot really is just tabs: take a look at the Tab Widget tutorial. Panorama is a bit more tedious: you can try embedding the View you want to pan into a HorizontalScroller. If it is wider than the screen it will let you scroll around horizontally. To get vertical panning as well wrap that with a ScrollView.

Categories

Resources