I want to use the FriendPickerFragment but instead of showing only the picture and name i would like to add more details like where he working? where he live?
Do you know how i can do it? and explain? or point me to example.
I look in the web to solution and didn't find something.
Unfortunately Facebook's FriendPickerFragment does not provide any methods to customize information it presents. The most reasonable solution is to create your own fragment with ListView. You should also create list's adapter feeded with GraphUser objects representing user's friends. List of friends can be obtained from server by using Request.executeMyFriendsRequestAsync(Session, com.facebook.Request.GraphUserListCallback) method.
Related
I am creating a directory of schools in android application and want to open their details on new page by clicking on it from list view. how should i handle it?
I would recommend to use a RecyclerView.
You can find a simple example here.
make Pojo of the student info and pass it to the next activity using parcelable object
I'm trying to display all available download country list like the image
i had try the getMapPackages (), and i can get a "True" as result, but i have no idea how to perform next steps.
Not sure if you already checked the documentation.
https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/maps-offline.html
After getMapPackages() , you can show the list on UI as you like and then user selects a Package, you can pass the Id into installMapPackages() method to download the map.You will need to add listner as well as mentioned in the link above.
Hope it Helps !
As Jithin has mentioned you need to add a MapLoader.Listener object by way of the MapLoader#addListener() method. There is example code demonstrating this on the MapLoader documentation page. https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics/maps-offline.html
Once you have added a MapLoader.Listener object, when you call MapLoader#getMapPackages() you will get a callback to MapLoader.Listener#onGetMapPackagesComplete. From here you can use the returned MapPackage object to find the names of the packages available for installation. API documentation for the MapPackage object can be found here: https://developer.here.com/mobile-sdks/documentation/android-hybrid-plus/topics_api_nlp_hybrid_plus/com-here-android-mpa-odml-mappackage.html
I have made an app where it opens up an online api(?) database. I used the ListView widget where each entry (name of something) clicks onto a new activity. I would like to know how to go about extracting data from the database and putting it in my app for example; if I were to get reviews about a shampoo showing on the page and also a picture of the shampoo etc.
Sorry if I make no sense.
It would have helped if you post some of your code.
According to what I understood is that you want to download data from server and show it into your list view.
What you can do is you can hit API in Asynctask. Put each item data like text, image URL etc into one bean class (setter getter) and add that bean into your list attached to your adapter.
Then you can call notifyDataSetChanged() on your adapter.
I am new to Android App development, working on an android app which populate a list of numbers, in a listview dynamically, depending on the choice of the user, but, the moment user closes the App, the items in the listview are lost. How can I maintain the state of the listview?
Examples with code would be highly appreciated.
When I open Activity A, it allows users to add friends, and this friend list is shown in the form of items of listview in the same Activity, however, when I move to Activity B, and then come back to Activity A, this friend list disappears. I need to make sure that this friend list should not be lost while moving between activities. Please help.
I think that for your purpose there are 3 main methods, i'll explain them from the easier to the most difficult (in my opinion).
Text File
A way to do this is to create two methods in a class:
one has to create the text file in the storage if it isn't created before and read that, the other has to append a String to a StringBuilder and write it on the previous text file.
For this method you need the uses-permission of reading and writing to storage.
This link can help you: http://developer.android.com/training/basics/data-storage/files.html
JSON (also XML)
With JSON file you can create a list of objects with your data that you can serialize when you update the list and deserialize when you want to read it. For this purpose you have to study JavaScript syntax or, at least, JSON one.
SQLite Database
Android SDK incorporate a class named SQLiteOpenHelper that you can extend to create a database inside your app.
This link can help you: http://developer.android.com/training/basics/data-storage/databases.html
There are also references saving methods but i think that aren't right for your purpose, they work betters to save something like preferences or single data like last login informations.
I went through your comment. I would personally suggest using SQLiteOpenHelper
You might need to understand the use of SQLite, hence the tutorial
Simple Flow. On your Activity 1 where person Add Friends save it to DB
Then refresh the List from the DB. So when you move to Activity 2 and come back again to Activity 1 your List will refresh from DB. Hence no loss of data as you want.
EDIT
As user wanted to know how to use the ListView with DB.
Following are my suggestion
Sai Geetha
Youtube
First of all I'm not native english speaker so I'm sorry if there is any grammar or spilling mistakes but I'm really trying to do my best here.
OK, I'm developing an application in android system for e-commerce, the user can add any product to sell, but as you know there are many filters questions.
For example if the user want to sell a car he has to select the model and the company of the car, but if he want to sell a mobile then the questions changed to select the storage for example and the model and the company questions will be deleted, so the questions here are dynamic.
I already developed the form using RecyclerView and its look great.
figure1
figure2
figure3
The problem that when I used
notifydatasetchanged
The form data get mixed!
I solved this problem using
notifyItemRangeRemoved and notifyItemRangeInserted
So it's working great, but I still confused why this is happened?
The second problem that is the dynamic form is a fragment called "DynamicFormBuilderFragment" and sometimes I have to replace it with another fragment like "Google Maps fragment" for example the problem that when I call back the "DynamicFormBuilderFragment" all my data is Lost and the form get duplicated!
Like this
figure4
I want to put some codes but really I don't know what to put because they all are too long and complex, but for start I think this problem because I made the RecyclerView.Adapter not static, I will try for now to made it static and see what happens, but I still need your help please.
Thanks for reading and I wish to you a great day and happy coding.
Update
this is my java files and classes
AddAds.class extends ActionBarActivity
DynamicFormBuilderFragment.class extends Fragment // is contain RecyclerView + Adapter + LoadToAdapter + questions classes and it's where dynamic form get build.
GoogleMaps.class extends Fragment
SLOVED!
I Replaced the RecyclerView with the ListView and it's working great now so thanks #greenapps.
I think it's a bug so I will reported to Google.