android - BB10 compatibility - android

I am newbie to convert android apps to bb10. I converted one app to bb10 compatibility. The app is compatible with both device and tablet in android.I successfully run it in bb10 simulator. But the app doesn't show the UI part completely. Why? I have one more doubt generally BB10 devices shape is rectangle but simulator shape is square. why?
BlackBerry Image
Android Image

That is because your UI needs more space than the resolution provides. If you would place your controls within a scrollable container, you would be able to scroll down to the missing parts of your UI.
If you choose that container to automatically show the scrollbar, this would only be seen on Q10 but not on Z10. Try to switch your simulator to Z10 resolution, then it will propably show all your UI elements.
The real solution would be really to define the UI in relation to the resolution.
To start with this, here is an excellent definition on how to cluster your layout resources for your Android app. Your problem will disappear, when defining an appropriate layout for the minimum height(!) of e.g. 600dp and one for 800dp. The one with 600dp will be used for the Q10 (because it has 720px physical height) and the other one for the Z10 (that has 1280px).
By the way: you should encounter the same problem on some Android device, since there are a few with nearly square display (I remember a "BlackBerry clone" by HTC?). But of cause, these devices are really rare...

Related

Make Android Studio apps available for all devices

I have a question about Android Studio.
If I develop an app that I then upload to the Google Play Store, can I be sure that my Android Studio project runs well and looks good on all devices with an Android operating system?
So that the layout that I developed works well on all screen sizes? Will Android Studio do this for me on its own?
Or do you have to develop your XML layout for each individual smartphone with different screen sizes?
I would be very happy to hear from you.
best regards
However, applications created in android studio will be able to fit all api's that you define in your gradle, it is recommended to test in the emulator from the initial api defined in the gradle, but in general it works well on several devices. The test is ideal to check if there will be no crash in some API's but the layout is usually positioned according to the screen of each device.
Good luck on your project.
So that the layout that I developed works well on all screen sizes
For this, it depends on how you did your layout. Android has constraint layout which is the best to use
ConstraintLayout is a layout on Android that gives you adaptable and flexible ways to create views for your apps. ConstraintLayout , which is now the default layout in Android Studio, gives you many ways to place objects. You can constrain them to their container, to each other or to guidelines.
Or do you have to develop your XML layout for each individual smartphone with different screen sizes
For this, it will only base on your use case or if you have different UI design for phone and tablet devices, for example, you want your app to show a two-pane layout on a larger screen (or a tablet), then you have to create a new xml for this. So you'll have mylayout.xml placed in layout folder (for phone device screen sizes) and mylaout.xml placed on layout-600sd600dp (for tablet device screen sizes).
But if you only have on design for both phone and tablet devices, then you only need one xml layout.

How can i give support Multiple Device Support in react native?

Explanation:
I have created an application in which it's looking well in an android phone(480x320, such type of devices) and iPhone 7 plus and below. When I run my application into the tablet Nexus 7(nougat). It reduces the font size, Images and even height(which specify in the CSS) of my views.
In Android, we have different types of the drawable folder to easily manage multiple device support based on the values folder also.
Problem: How can I manage my application which will run on all the devices including phone and table in Android and iPhone and iPad in iOS?
Well you asked THE question. Looking through the react native elements library I found a function they call normalizeText, you can find it here:
https://github.com/react-native-training/react-native-elements/blob/master/src/helpers/normalizeText.js
Basically they take the pixel-ratio api, which docs you can find here:
https://facebook.github.io/react-native/docs/pixelratio.html
and depending on the screen size they multiply the values of with/height/font using that functions with values from 0.5 to 2. I found it a good solution to get a good visuals on every platform.
For the UI I would recommend you to use flex as much as you can, because it gets your app independent of width and height.
If you need some clarification feel free to comment.

Creating a 'universal' app in Android Studio for smartphones and tablets?

I've been using Xcode for a few months now to create basic iOS applications. Within the startup settings, it allows you to select 'iPhone', 'iPad' or 'Universal'.
I usually setup my applications so that they are locked portrait on iPhone and locked landscape on iPad.
Firstly, how can I setup my project so that it is available to both smartphones and tablets when pushed to the Google Play Store?
Secondly, is there a way to set the orientation to portrait for smartphones and landscape for tablets?
I think what you want is that the app should adopt its view according to whether the device is a phone or tablet. If so, Android provides a very good design called Master-Detail Flow. In a master/detail navigation flow, a master screen contains a list of items in a collection, and a detail screen shows detailed information about a specific item within that collection. And the beauty of it is that, in a phone it only shows the master view as a list and in a tablet it shows both master and detail in two panes.
Take a look at this and this
Also for other adaptive UI see this
The concept of Android O.S is entirely different from iOS. Primarily, think of all the Android devices that exists! Lot of manufacturers, in different screen sizes and with varied configurations. However, an Apple iPhone is designed and manufactured by Apple, and it comes like a brick in different sizes. So it offers more of a robustness to the developer.
But in Android, due to it's versatility, there comes a need to design apps that runs equally same in all devices even with different screen resolutions. As a result, Android uses a technique called DIP Display independent pixels to address while designing. [This] is the perfect place to get a structured knowledge on Android UI designing and scaling to different screen sizes.
Now coming to your second question, Android offers superior flexibility to the developers. And you can easily adjust the orientation programmatically:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); //<-- Landscape mode
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //<-- Portrait mode
Hope this clearly answers your query!

A Mobile Phone App API without these limitations

I have been developing Mobile phone apps in Mosync(Cross Platform C++ API - can make apps in iOS, Android, Symbian & Blackberry) & I am looking to develop apps in something else because of the limitations of Mosync.
But I dont want to move to a different API to find they have the same or worse limitations. I am thinking of moving to native API's (iOS or Android) but am open to other cross platform API's aswell.
If I was to move to Android OR iOS OR insert API here would I experience these limitations:
Resizing images is expensive(in terms of RAM & speed). IE, so can Android, iOS handle resizing 10+ images(for eg .png) & display them on screen in a relatively fast amt of time? In Mosync doing such stuff depends on the phone RAM but on HTC Desire(512mb) it takes about 6 seconds which is unacceptable for my app.
Does the API come with its own fonts & layout managers? Mosync doesn't have its own fonts, you have to create & import it & you cant change the colour of a font. You also cannot make the text in a widget display centred or word wrapped, can Android/iOS/other do this?
Can you create your own skins(.png) for buttons(any widget) & set a default API button's skin? This is actually a strength of Mosync where you can change button skins BUT it divides the skin up into 9 sections & only the 5th section is scalable, the others stay the same size, so on small phones a lrg skin looks weird.
Is it a REAL headache designing your app layout because of all the different potential phone sizes there are, so the widgets placement & skins will be incorrect on small screens & images will be out of proportion on large screens? Does the Android/iOS/other API help you by automatically laying out your GUI no matter the phone size & does it automatically scale image widgets & fonts to suit phone sizes?
Any info would be really helpful to a Junior programmer(intern) who is developing mobile apps all on his own & finding the myriad of phone sizes so ANNOYING to compensate for
My experience with Android Code:
Image resizing - Many current android apps seem to meet your
performance requirements although you don't mention the size of the
images which is the key issue.
Android supports many fonts internally, allows full control of font size, type face, colour etc
Android supports a complex variety of 'Drawables' including standard simple
graphics, 9-patch pngs (similar to what you describe) and simple vector descriptions of shapes and colours.
Android was designed with the difficulties of multiple screen sizes in mind; It supports multiple layouts for different screens sizes and orientations. This problem is intrinsically difficult and imho Android takes a lot of the trouble out the process - but it is always going to be a little bit of headache.
I am just reaching production on my first serious android app and have found the development experience pleasant and the learning curve easy.

How do I ensure my android app will look the same on all android phones?

Is there a truefire way to make sure my app will display the same on my Motorola Droid 2 as it will on other Androids?
I use nothing more than basic Linear Layouts, Image Views, Buttons etc - is there a good checklist to go by before I even think about launching an app?
Clipping issues, What SDK I should launch my app in, etc...?
Make sure you are following the guidelines for supporting multiple screen sizes.
You can use the emulator to experiment with the different possible screen sizes and densities, as described in that document under how to test your app.
You can make emulator of different screen sizes to check your application.
One thing make sure you don't use "px"(pixels) anywhere in your application, use dp instead of px.

Categories

Resources