Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7994009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:01:18+00:00 2026-06-04T14:01:18+00:00

I am trying to do a simple weather widget for Android, that provides temperatures

  • 0

I am trying to do a simple weather widget for Android, that provides temperatures just for my country (Jordan). The website I am using for the weather records provides a JSON file with country regions data for many countries. The problem is that the file contains 2500+ objects, and it takes a really long time to be parsed. Thus, and as I actually need <100 of them (the regions of my country), I thought that I could optimize the file before passing it to the JSON parser, by taking off all of the records I don’t need. I don’t know if it’s a good solution, but it was what I thought of. Anyway, my problem now is getting the right Regex.

This is the URL of the JSON file.

As you can see, every object has four items. The one I need to check for is “icon”, which specifies the country of that region.

EXAMPLE:

{"value":"khalda","icon":"Jordan","label":"khalda","desc":"Amman & Madaba"},

What I could came up with so far is the pattern of the object I actually need. However, I need to get the ones I don’t need to be able to delete them. Here is the pattern: \{[^\{]*Jordan*[^\}]*\}, (This has to be modified so it validates when “Jordan” does NOT exist, which I couldn’t figure out.)

Any help/hint is highly appreciated.
Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:01:20+00:00Added an answer on June 4, 2026 at 2:01 pm

    Rather than matching and deleting the objects you don’t need, match and extract the single(?) object that you do need. It will be faster.

    (And I agree with minitech’s comment. Parsing the JSON file is unlikely to be the real bottleneck.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make work a self-updating functionality in an Android widget, something simple
I want to get just the filename using regex, so I've been trying simple
I am just trying a simple application, to make the browser fullscreen. this is
I am trying to find a free API that provides lunar phase predictions including
I'm trying to parse some weather forecast lines for chance of rain and temperatures.
Trying to simple update a row in an SQLiteDatabase Database. I can insert records
I am trying a simple thing in Seam using rich faces. i am displaying
I'm trying a simple RoR application and using nifty generator scripts for scaffolding, layout
I was trying a simple demo here: my attempt at using textualizer based on
I am new to ExtJs(using EXT js 4 ), I am trying out simple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.