How to display multiple Tiles dynamically Android - java

I have to display multiple tiles on the same screen. Each Tile contains header,contents, and footer that would be set dynamically. So each Tile would be display with dynamic data.
How can I develop a program in android SDK for TABLETs

Just to get you started, you could have a look at Fragments (and Activity's) or perhaps even a ViewPager.
All these tips require a certain base knowledge on Android, though, just as #aneal commented on your question.

Related

Designing for different screen sizes using ConstraintsLayouts

I have started to dive into the Constraints Layout that were announced on the IO this year. This looks very promising and makes your layouts very efficient. I have seen the codelab excersize provided by Google. However I have the following questions that I would like to resolve.
How can ConstraintLayouts be used to design the layout for different screen sizes?
Currently I design the layout and set the views' margins and paddings etc for a specific device/screen group. Save those values in the dimens.xml file. This is a REALLY painful method to design the layouts. Does the Android ConstraintsLayout mimic the AutoConstraintsLayout of iOS in designing for multiple screens as well?
Does designing the Layout for different screen orientation still need different Layout.xml files i-e; layout_landscape.xml and layout_portraint.xml?
Yes, the entire point of ConstraintLayout (and for that matters, any Android layout since Android 1.0) is to be able to handle different screens (dimension, density...). You have nothing special to do (other than specifying constraints between widgets).
If you want to design for different screen sizes, think about margins as "minimum" spacing; and create constraint between widgets so that you position widget relative to other widgets.
You also have guidelines and bias centering, which give you a lot of flexibility.
Regarding the screen orientation, it is entirely up to you -- if you do nothing, the layout you define will be applied on either orientation. So, it would "work". But often, you want a different UI between portrait and landscape. In that case, you can indeed create two layout files, and the usual system will pick the right one for you.
Finally, you can easily test how the layout you are working on would behave in a different screen/device by changing the current screen definition from the popup in Android Studio:
You can also use the resize handle to see the layout to an arbitrary screen dimension.
How can ConstraintLayouts be used to design the layout for different
screen sizes?
If by different screens you mean phone and tablets then you have to create different layout for them. one way to do it is to define layout-sw360dp,layout-sw600dp and layout-sw720dp.
Currently I design the layout and set the views' margins and paddings
etc for a specific device/screen group. Save those values in the
dimens.xml file.
You might wanna look into chains and guidelines.
Does designing the Layout for different screen orientation still need
different Layout.xml files i-e; layout_landscape.xml and
layout_portraint.xml?
Yes.

Tablelayout with massive data android

What is the best way to create a table layout or recyclerview/listview/gridview in android that can pull a lot of data around 1000 rows and around 50 columns each row without to crash ?
I want to show it like excel sheet nothing special just show data of course with scrolling both ways.
TableFixHeaders project on github has an implementation with both Adapter an Recycling of views, plus handles scrolling wery nicely. And is quite easy to modify to suit your needs.
This is not so uncommon request, so it has been done numerous times. I am sure you can find other implementations if this one is not right for you.
I saw a similar question on SO a few months ago, and I was interested to see if I could develop a solution.
My concept was to start with a ListView for vertical scrolling and view recycling. Each list item is a HorizontalScrollView to show a table row with many columns. The trick here is to listen to each HorizontalScrollView for swipe events and then scroll every HorizontalScrollView in sync with the view being swiped.
I have a proof-of-concept project on Github here:
klarson2/android-table-test
Downsides: The project was set up for Eclipse, so you can't open it directly with Android Studio. There is still a small bug with event handling that I haven't got around to fixing. Another limitation is that each cell view in the horizontal LinearLayout must be a fixed size so that the columns will line up correctly.
However, the example uses a 4MB .csv file with 50 columns and over 10,000 rows for a data source proving that it is possible to display an enormous table in an Android app with responsive two-way scrolling.

Android: Yahoo Weather App Horizontal Scroll-view Effect?

I would like to know what the Android implementation is of this type of scrolling that you see in the Yahoo Weather App. Here is a video example:
http://www.youtube.com/watch?v=a-q_yetkpik
Any examples or ideas on how to implement this would sincerely help this poor lost soul!
Thank you
use that library https://github.com/xgc1986/ParallaxPagerLibrary, it's very easy to use, and it worked for me
demo
You should separate two different things here:
The horizontal scrolling
As you swipe your way through the viewpager, the background moves slower than the content does.
This effect can be achieved with the ParallaxPagerLibrary
The vertical scrolling
As you swipe up, the background image blurs away, making the "swiped up" content more visible to the user. This post explains it all and also provides a library.
But if you want it even better, someone wrote a simple "clone" of this weather app https://github.com/MoshDev/LikeYahooWeather
They customized ViewPager, the widget is called WeatherViewPager that it's unfortunately unavailable, looks like a ViewPager with a sort of parallax
You may take a look at https://play.google.com/store/apps/details?id=com.desarrollodroide.repos
it's a collection of usable opensource libraries
e.g. Utils->Paralloid or Utils->ParallaxScroll

Possible implementation of game screen concept for an android game

I want to develop an android app, but I'm still not that great at using xml or the eclipse wysiwyg editor to make scalable and robust interfaces!
Below is a quick concept I drew up on word of what my main game screen will consist of:
I'm currently thinking a vertical linear frame first, with a frame that doesn't change for my important stats etc., then a frame in the middle which is switched by the buttons, but I'm stuck on how to implement this.
For the centre button screen, the map screen, I am hoping to add an image of a map which can be moved around, and somehow attach invisible button objects to points in this picture, maybe with an array of squares or something?
I understand this is a pretty open question and might be difficult to answer, but if you think you can help in anyway please do.
Thanks!
There is a log of possibilities, but you can use a LinearLayout with android:orientation="vertical" and include your stats in top. For the changing screens with buttons you can use a FragmentTabHost and create different Fragment for each of your views.
Check this example with a implementation.
Regarding the map, I think the easiest option is to use Google Maps Android API v2. Here is a example to use the maps v2 and a example of how to add markers to the map.

View different images depending on what item in my list view I click

I'm fairly new to Android programming and I've got this project I need to finish and I'm currently stuck.
I've got a standard listview in a Menu class with an array containing around 20 different elements. So what I want to do is load images in an imageview depending on which item in the listview I click, and since I'm a beginner the only idea I had was to make a new activity for each imageview which seems like a pretty bad way to do it since I'd need about 20-30 new activities..
To sum things up what I want is:
Code for making ONE activity that will display a different image depending on which item in the listview I click, probably pretty basic coding I want as simple solution as possible.
If possible I'm also looking for a solution that includes an SQLite database that stores the URL of an image and then display it in a single activity, also depending on which item I press in my current listview.
(I hope you understand my needs, and if you need I can also post my current code for the Menu class if it helps you help me) Or you can just show me a different way to make this work, I appreciate every answer! Thanks in advance!
NOTE
And please keep in mind, I'm a noob at Java and Android so keep it rather simple or at least explain what you do.
When you click on a list item, display the image in another view in the same layout, unless you want the image to take up the entire screen real estate. If you want it in the entire screen, go to a new Activity by sending the activity an Intent.
Activities are the "controller" of your application. They interact with the visible UI and the input from the user. You don't need a separate activity for each image, just an activity that's associated with a "place" in the UI (an ImageView) where you'll display the image.
I'd start by adding the images as resources under res/drawable before going on to databases.
You are going to have to do most of this yourself. There really isn't any substitute for taking the time to learn Java and Android. There are several tutorials and Android University classes under the Resources tab in the Developers Guide; I suggest you do all of them.

Categories