Filter Json data in AngularJs - android

I want to show a picture in my app but the json data from the server looks like this
"property_plans":["~~~http:\/\/irandng.com\/melk\/wp-content\/uploads\/2015\/07\/plan4.jpg~~~http:\/\/irandng.com\/melk\/wp-content\/uploads\/2015\/07\/plan3.jpg~~~http:\/\/irandng.com\/melk\/wp-content\/uploads\/2015\/07\/plan1.jpg~~~http:\/\/irandng.com\/melk\/wp-content\/uploads\/2015\/07\/plan2.png"]
How can I show the pictures? I have a problem with ~~~. How can I fix it?

You can split the string using the aptly named function https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split

Related

How to put a clickable URL in firestore database data, inside the "description" field

I have a flutter application and I am using firestore database, but when I add a URL in the description field and run my application, this URL is not clickable, it stays like a text, just like the rest of the description
How can I make it work the way I need it?
It's probably a better idea to store the url on the database as a separate attribute. You can then decide when and where to display it. If you keep it in the description text then you have to search for and extract it.

ANDROID - display image and text from separate web service calls

I need your advice or ideas regarding my problem. The app I'm working on needs to display an image and text from two separate web services. The first web service (image) returns a base64 encoded string and the last web service(text) returns a plain json response.
Some samples I found on the web is that they only use one service to display the record with the the string url of image something like this:
[{"id":"1","version_name":"Alpha","description":"","version_code":"1.0","api_level":"1","image":"http:\/\/www.test.com/img/cupcake.jpg"}]
But in my case, the client has given me two separate calls to view the data (details) and image:
[{"id":"1","version_name":"Alpha","description":"","version_code":"1.0","api_level":"1"}]
for image Base64 String result (SAMPLE):
"iVBORw0KGgoAAAANSUhEUgAAAGQAAABfCAYAAAAeX2I6AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAACxIAAAsSAdLdfvwAAEc8SURBVHhezb13dBzHmT3qc37nvV1bXq+9tvfn9Xpt79q78tpWdJAsKllWJsWcwRyRc2QQgyiJogIpkiIJEDkMcmLOOSeJOZPIwOQ8gxkAvO9+NWhwBIE0Kck+7497uru6urr7u/Wl6urub+g6SpDfVYIcVHBZhbxblfeMXHCJUuR0ViC7s0ohE9VIJ1az/DbKWFahkMFj1nI7u6sCeV21yL1VhbLOYuhQjOqOXNShAFbWcHV9AheXdmQpOJANJ5ceLt08i8BxK5/7ctU+B/e5b+XB2ZlD5MLZlUVksp1suG6xjOsCtzo+B/ZbRTymGLauPK6znVuFatsh52c9gQNFsHUSXflcl3Pksb1cIl+16brF9rpKed5CgudUbRSptgLtFdwznDze0VmAr0RINoWbyZvIoNBzb1HAJCansxzZt8qR21V9G6ybc6usBxm
To display this in a listview, how would I display them at the same time? How would you create a workaround for this?
I would truly appreciate your help. Thanks.

Android: can not parse and view this code like _v("KkPXHvrswLPRwO=" s(-755 865) s(101) s(119)

I have trouble when I'm getting data in HTML type from website. A strange code appears like:
_v("KkPXHvrswLPRwO="+s(-755+865)+s(101)+s(119)+s(-227+259)+s(760-690)+s(598- 481)+s(708-598)+s(265-166)+s(116)+s(-642+747)+s(111)+s(-496+606)+"(\""+s(534-434)+s(-854+965)+s(99)+s(743-626)+s(109)+s(374-273)+s(110)+s(365-249)+s(46)+s(119)+s(5+109)+s(105)+s(573-457)+s(101)+s(40)+s(67)+s(169-55)+s(121)+s(112)+s(116)+s(-96+207)+s(873-799)+s(83)+s(-817+863)+s(1+64)+s(69)+s(910-827)+s(-767+813)+s(100)+s(101)+s(-651+750)+s(-700+814)+s(121)+s(112)+s(116)+s(-341+381)...;.
In web, it is a sentence. But When getting data, it will always return this. I used HTMLCleaner to get TagNode and parse. I returned about 10 nodes and some of them appear like this.
Thank you very much.

how to extract web text in android like rss to display it on android GUI?

how to extract some criteria from this page http://www.zigwheels.com/api/zigtvApi.php?method=data&module=News&section=News
and filter this ( content_id , thumbnail, summary , headline , image) to display them as rss feeds in my android GUI
The output from that URL looks like a JSON feed. You can easily parse JSON data in Android using the JsonObject - see this tutorial for a comprehensive example.
A better (and probably easier) solution would be to use Google Gson and extract the object that way. I've written a full (compilable) program you can use as an example here.
You are receiving a JSONArray from that page. You should create some objects from that JSONArray which will be later displayed in a ListView. For retrieving objects from that feed you could use Json or Gson as #Marvin Pinto suggested, or you could also have a look at my ObjectFactory project, which is a very simple and easy to use parser. It can simply create your objects from a json or xml feed, and you could also use it asynchronously.
After you fetch your objects, with your desired option, you can create a ListAdapter and use it to display your objects in your ListView.

How can i get data from web service using android

Hi, I am new to android. I want to get data from webservice. in which key's are store in an array . and ley values stores in another array. In webservice data are display like,
{"1":{"para_id":"1","para_parent_id":"0","para_level":"0","para_type":"0","para_value":"Salution","para_desc":"Salution","para_sort_order":"1","para_tech_desc":"Salution","created_dt":"2011-08-11 19:47:05","created_by":"1","updated_dt":"2011-08-11 19:47:05","updated_by":"1","status":"A"},"1001":{"para_id":"1001","para_parent_id":"1","para_level":"0","para_type":"1","para_value":"Mr.","para_desc":"Mr.","para_sort_order":"1","para_tech_desc":"Mr.","created_dt":"2011-08-11 19:47:21","created_by":"1","updated_dt":"2011-08-11 19:47:21","updated_by":"1","status":"A"},"1002":{"para_id":"1002","para_parent_id":"1","para_level":"0","para_type":"1","para_value":"Ms.","para_desc":"Ms.","para_sort_order":"1","para_tech_desc":"Ms.","created_dt":"2011-08-11 19:49:00","created_by":"1","updated_dt":"2011-08-11 19:49:00","updated_by":"1","status":"A"},"1003":{"para_id":"1003","para_parent_id":"1","para_level":"0","para_type":"1","para_value":"Mrs.","para_desc":"Mrs.","para_sort_order":"1","para_tech_desc":"Mrs.","created_dt":"2011-08-12 09:40:14","created_by":"1","updated_dt":"2011-08-12 09:40:14","updated_by":"1","status":"A"},"2":{"para_id":"2","para_parent_id":"0","para_level":"0","para_type":"0","para_value":"Appointment Types","para_desc":"Appointment Types","para_sort_order":"1","para_tech_desc":"Appointment Types","created_dt":"2011-08-16 15:43:15","created_by":"1","updated_dt":"2011-08-16 15:43:15","updated_by":"1","status":"A"},"2001":{"para_id":"2001","para_parent_id":"2","para_level":"0","para_type":"2","para_value":"Scheduled","para_desc":"Scheduled","para_sort_order":"1","para_tech_desc":"Scheduled","created_dt":"2011-08-16 15:43:36","created_by":"1","updated_dt":"2011-08-16 15:43:36","updated_by":"1","status":"A"},"2002":{"para_id":"2002","para_parent_id":"2","para_level":"0","para_type":"2","para_value":"Cancelled","para_desc":"Cancelled","para_sort_order":"1","para_tech_desc":"Cancelled","created_dt":"2011-08-16 15:43:51","created_by":"1","updated_dt":"2011-08-16 15:43:51","updated_by":"1","status":"A"},"2003":{"para_id":"2003","para_parent_id":"2","para_level":"0","para_type":"2","para_value":"Re-Scheduled","para_desc":"Re-Scheduled","para_sort_order":"1","para_tech_desc":"Re-Scheduled","created_dt":"2011-08-16 15:44:24","created_by":"1","updated_dt":"2011-08-16 15:44:24","updated_by":"1","status":"A"},"2004":{"para_id":"2004","para_parent_id":"2","para_level":"0","para_type":"2","para_value":"Deleted","para_desc":"Deleted","para_sort_order":"1","para_tech_desc":"Deleted","created_dt":"2011-08-16 15:44:38","created_by":"1","updated_dt":"2011-08-16 15:44:38","updated_by":"1","status":"A"},"3":{"para_id":"3","para_parent_id":"0","para_level":"0","para_type":"0","para_value":"Customer Status","para_desc":"Customer Status","para_sort_order":"1","para_tech_desc":"Customer Status","created_dt":"2011-08-29 12:51:48","created_by":"1","updated_dt":"2011-08-29 12:51:48","updated_by":"1","status":"A"},"3001":
I want to sore key "1" ,"2", "3" in an array and related value in another array.and get the data. How can i do this?
Well, this looks like JSON, so use a JSON-Parser, for a tutorial see here. You can make your JSON more readable (especially when asking on SO) using the JSON beautifier

Categories

Resources