Make an android app works for multiple screens [duplicate] - android

This question already has answers here:
multiple screen support in android [duplicate]
(4 answers)
Closed 1 year ago.
If I make an android app using android 2.3.3 and after completion i make it work for other devices, is this a good idea ? Because i have not developed app for multiple screen sizes. Would it be more time consuming ? What precautions I would have to take ?

The best place to start this kind of research is with Google's Android Development website, which has tons of helpful guides and resources. Here are two links which may help you with your problem:
http://developer.android.com/guide/practices/screens_support.html
http://developer.android.com/training/multiscreen/screensizes.html
And another which discusses layouts. The Dev Guides have a bunch of mini-tutorials to teach you how to use and the differences between many views.
http://developer.android.com/guide/topics/ui/declaring-layout.html
On the whole, you should definitely start coding with multiple screen sizes in mind, although this goes along with just having good android coding practices. In general, get acquainted with the xml attributes that start with android:layout_ for example android:layout_width and android:layout_weight and the way your image resource folders need to be managed. In my experience, once you get comfortable with how layouts work on Android, making sure they work over multiple screens will come easily. Having a basic understand of it before get in too deep in will save you a lot of headache and recoding later. Don't be afraid to make simple apps to test different layout techniques you're learning. Good luck.

I think you should do more research from your part, but here is a link to get you started.
http://developer.android.com/training/basics/supporting-devices/screens.html

First decide on the minimum SDK version you are willing to support (let's say minSdkVersion="8" for example).
Second, build your application against Android 4.1 and set your targetSdkVersion="16". Doing so will allow you to make use of some of the prettier UI features (i.e. Holo themes) on newer devices.
Third, test your application extensively using the emulator on devices running SDK 8 through 16. If you make any method calls from the newer APIs, make sure you prevent older devices from invoking these methods (as they will not be recognized and will crash your app at runtime). At this point you can optimize your application for different screen sizes (i.e. phones and tablets).

Related

How to reuse existing Qt code under Android?

I have an application that was developed using Qt. This application currently runs on many different platforms.
Now, I am looking for ways to reuse this code under Android. I noticed that there is a Qt library for Android available. However, I haven't come across any article that discusses the migration topic.
I am wondering if there is a way to reuse or reorganize our existing code such that the same code base can be used on Android as well as other platforms.
Try to comile your app with qt5.1.1 for Android. Eventually it will run, but i am pretty sure you will have to redesign your UI, otherwise you get "Desktop-like" App for Android, which for example results in a horrible small scrollbar on high-res screens. Generally Android can run QtGui and QtQuick. There are also QGestureRecognizer available for grabbing native gestures. QSesor (and subclasses as QGyroscope, QOrientationSensor,....) for reading mobile typical sensors. While QtQuick eventually is a better fit, QtGui is still working fine.

Asp.NET Apple Android Windows8 phone GUI

I am thinking of developing a program within ASP.NET. But that I could port easily to Apple, Android and Windows phones and tablets. I also want the program to be able to run on PCs (MACĀ“s?).
This seems to be fine. However, the normal GUI of Windows does not look at all like the GUI from e.g. iOS or Android. And this would be a big show stopper. It should be at least optimized for touch mode. So all on screen widgets should be a bit bigger.
Are there libraries, providing controls, which looks like normal ones on the operating system? It would be best if this works kind of automatically. So the program should find out where it runs and load the standard GUI best fitting to the device, where it is being started.
I could of course develop own controls, but this may be a bit too much of effort.
It would also be very nice if the library would handle different screens or modes like portrait and landscape. So that it may switch depending on the orientation of the tablet, or phone for instance.
I am searching for something like that, which provides a good result, without the programmer needing too much to do by himself.
I also like if one can recommend a library he is using already by a bigger program. From my own experience, you get to know the strengh and weakness of such libraries with the time passing by.
Best Regards.
I already discovered some tools like PhoneGap, Sencha, Mono. I do not know, if these are well suited for me.
I like to create an app most likely for all plattforms at the same time. Is this the case with e.g. PhoneGap?
I am not familar with JavaScript, or CSS or HTML development.
I am an experienced C# programmer and I am quite familar with Java. So VisualStudio is my daily working environment, and I am using Eclipse also a lot.
Mono:
I only read about it and found out this aspects:
cost 999$ to use it in Visual Studio. Hope that this price includes development for all plattforms and not just one. Did not yet check this.
The coding looks very good.
There are APIs for Android, iOS, and Windows Phone to setup controls. So these parts needs to be rewritten for any supported application. One may create a core library, which can be used for all components. This aspect is not so nice.
However, I would prefer a solution, where the GUI is even described on another level. And then it should be brought to the current plattform automatically, if not specific libraries are used. So HTML5 may be more flexible.
Best Regards,
Patrick

An approach to porting a project to another platform

I am an intern at a company trying to push an android and iPhone out out within the next 5 months. Today, I received information about my first "real" assignment which will entail porting the iPhone App to the Android platform. Here's my problem though: I've never seen a single line of Objective C code and I only just started programming in Java and for Android devices last wednesday.
So how do I go about porting an application? Where do I start? How do I best organize myself and get an overview of which tasks to complete and when to start working on them ?
tldr; How do I port an application to another platform?
Word porting means in effect creating an application on another platform (in another language if needed) that maintains the same functionality. As iOS and Android use different languages and internally very much different operating model, you cannot simply take iPhone code and translate it line-by-line into Android.
What you do need to do is analyse the functionality of the iPhone app and create an app for Android that will perform the same functionality. Do not approach this as a direct "porting" project, but rather as a new development project. You may be able to translate some business logic one-for-one - but anything related to the user interface (and, most likely, to any back-end server communication if you have any) will need to be written from scratch. You may encounter certain things that are present in an iPhone but are not supported at all in Android, or are very complicated to implement, so try to think how to substitute them with whatever Android does support.
The biggest problem you'll encounter with Android is the multitude of screen sizes and versions, each of which may behave differently and support different things. I suggest you start from the beginning and do one screen at a time, adding functionality step-by-step until you get the desired app.
5 months is a long enough period of time to complete the job for almost any app. Good luck!
P.S. I have gone through this exercise myself: having an iPhone app I had to "port" it to android platform. Using the approach I described, it took me about 2 months to complete the android app, which initially took about 3 months to create on an iPhone platform.

Moving an existing app to Android 3.x

I have a published app for Android 1.x and 2.x, and now I want to make it support 3.x.
But Android 3.0 has massive API change, especially on UI, thus if I want to make one app compatible to 2.x and 3.x, the code will be ugly and package file will be huge.
On the other hand, if I make another app for 3.x, then I need to maintain two copies of their common codes. That's really annoying.
What should I choose, or does anyone have a more smart solution? Thanks!
If you package them together you could still maintain everything separately - For example: put a prefix in front of every layout and class for 3.x, such as honeyMain.class, and honeymain.xml
Or you could do it a way that makes more sense for you.
Or keep them partially together.
It WILL make your app larger, but then when 15 people with 3.x download it and 60 people with 2.x download it, you get 75 downloads, instead of 15 for one app and 60 for the other. The 75 cumulative will look better on the apps over all ranking on the market.
On the other hand, if the 3.x is really ugly or FCs, then negative ratings will impact both 2.x and 3.x, but that is easily controlled for by testing, testing, testing.
Also, I personally hate managing code for two different apps. It's overly repetitive.
So, my recommendation is to package them together.
Make use of resource qualifiers, e.g. -xlarge, -v11, etc.
Use reflection where necessary or other techniques to avoid pulling in stuff not supported by API level.
Use the compatability library, that way you can fragmentize your code regardless, avoiding duplication, and with little effort handle different screen sizes.
See providing resources
See multple screens
See compat lib
Right click on your project and select "properties",select "android" from window,and which type of version you want check it and apply

Using the deprecated AbsoluteLayout class in Android?

The AbsoluteLayout class is deprecated but still can write it in code and it works. Will there be any problems if I use this class? Will the application work correctly after I deploy it on a phone?
Thanks
Deprecated generally means that you are discouraged from using it because better methods exist. It can also serve as a warning that it will be removed entirely in future versions.
I would think you would want to stay away from absolute layouts because it can prevent your UI from scaling correctly on different resolutions, and it might not work at all on later versions of Android.
"will the application work correctly after I deploy it on a phone" most likely yes, but like I said you are probably going to run into issues with phones having different display resolutions.
This is a mighty assumption. It depends on the purpose, a business application on a standard large-screen device (tablet) may have a reason to go absolute.

Categories

Resources