I am trying to use
com.github.stfalcon:frescoimageviewer:0.5.0
to show images from sdcard. Here, is the code which i am using
new ImageViewer.Builder<>(MyImagesActivity.this,
imgs) // what is this?
.setStartPosition(i)
.show();
The problem is I can't figure out what is the second parameter(imgs). The doc suggests that it is a list or String[]. But I don't know what it is. Is there anyone who has used this library. Any suggestion might be highly appreciated.
You can pass Urls or Uris of the images as Objects[] or List.....
for Example...
String[] a={"https://viralsweep.com/blog/wp-content/uploads/2015/02/unsplash.jpg","http://cdn.mos.techradar.com/art/other/Beach-970-80.jpg"};
Fresco.initialize(MainActivity.this);
new ImageViewer.Builder(MainActivity.this, a).setStartPosition(position).show();
This also help you
Related
So I have JSON, I parsed in and it's sitting there. From my code below it looks like I have put everything into an ArrayList but then what? I mean for example I need the "title" of each JSON object to be an onClick on the first page, is that possible?
Essentially my onPostExceute() is empty/not doing much. Eventually I need to separate each object into it's own page via the onlicks I'm mentioning, but I think I can do that by separating the JSONObjects...? guess I'll come to that when I can.
If I want to separate things should I even be using an ArrayList? It's just what I used for a server test I ran with different code.
Would really appreciate some help. Basically stuck at the last hurdle is how I perceive it. Maybe I'm wrong though. The logs see that the JSON is showing up as one big chunk.
Edit: Removed my code, this is more of a theory question. ListView being the best thing to go with.
yes you can make spearate arraylist for them..and can store them in diferent listviews...on google click you can open new listview showing id and link for google ..and same you can do for microsoft and your other trem.And using onItemClick is a gud option,you can easily get the index of item clicked//
Programming my application would be a lot easier if I could refer to an array by URI, and use that array to inflate a list. Has anyone done this? Thanks in advance!
No, it's not possible to refer to an array using a Uri in the same way that you do using R.array.yourarray.
Technically, just to say the proper answer, you could wrap an object to parse the Uri for you and return the R.array.yourarray for you. Like a Content Provider, for example. But obviously that is just nonsense, there is no reason to create a non standard thing when the standard works just fine.
I don't think there is any scenario that would require a Uri that the standard way doesn't handle just fine.
What would the best approach to :
get html codes by calling url and displaying it in some views
if i would be editing the values against title tag, it must be automatically updated in the url link?
How to do this?
Check out the JSoup cookbook.
http://jsoup.org/cookbook/
This has a lot of good information in it and should be able to answer most of your questions.
You are probably looking for something along the lines of this: http://jsoup.org/cookbook/input/parse-body-fragment
I have list of records in xml format from my local host "http:localhost:810/Service1.svc/leb/GetAllCustomers"
Can I call this to android and list it in Textview or Spinner or in EditTextView or in any of the controls in android?
You should parse this xml file using SAX parse or Dom Parse in android and collect date in arrays/list/map according to your requirement here i am post some link to you get more information form there and get your ASAP.
http://www.androidpeople.com/android-xml-parsing-tutorial-using-saxparser
http://www.androidpeople.com/android-xml-parsing-tutorial-%E2%80%93-using-domparser
I hope this is very helpful to you.
Some links here for you.
1) Multithreading for Performance
to help you understand, how to download a file (example shows downloading an image) via AsyncTask.
2) Working with XML in Android
to help you parse your xml. Check these out. Good luck!
Yes you can do that.
Use Intent which takes URL as an argument.
In the URL you can mention the location/URI of your source.
Then, you can parse it to a string and store it.
Later, use ArrayAdapter to populate.
I can get you code if this is what you are trying to do.
Does anyone have some helpful links to find out about Android Uri's?
For example, you get a Uri back from a "take a picture" Intent. What does a URI look like and how do you use it. Why are they used instead of filenames or file handles?
The Dev documentation on the Uri class is practically worthless. http://developer.android.com/reference/android/net/Uri.html It is only clear if you already know exactly what it is, and how to use it.
Thanks for any links.
I'd check out the content providers section
http://developer.android.com/guide/topics/providers/content-providers.html
It expalins URI's for the different content providers and how they work.
Read this post it explained what is URI and URL ? Hope it will help to you.http://javapapers.com/servlet/uri-and-url-difference/
This is a list of URIs that can be used in intents.
http://www.openintents.org/en/uris