• Stars
    star
    154
  • Rank 242,095 (Top 5 %)
  • Language
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🧡 A comprehensive list of string-arrays that you may need on a daily basis when developing an Android app

Ultimate String-Array List

Feature Image

As an Android developer, I absolutely hate it when I have to worry about getting data for common use cases which involve things like list of countries, list of states or even letting the users enter their birth year. We see this in most android apps, especially the ones which have a form that a user needs to fill. Even if I do find the data , it is hardly in a format that I can use easily in my app. Honestly, this is πŸ’©!

So I decided to do this πŸ’© work for you πŸ˜„! This repo will be a comprehensive list of common use cases like these with data in a format which is extremely easy to use in an Android app.

We have enough things to worry about as an Android developer and collecting data for common use cases shouldn't be one of them!

Current List of String-Arrays

The repository has the following list of string-array. Please note that this is continuously being updated so do check frequently. You can also send in your requests via the issue tracker. I am hoping that you take some inspiration from the categories I am adding and make contributions to this repo to make it more useful.

Name Description
App Categories.xml List of app categories present on the Google Play Store
AWS Regions.xml List of codes and names for AWS region
Canada Province Codes.xml List of codes of provinces in Canada
Canada Provinces.xml List of provinces in Canada
China Province Codes.xml List of codes of provinces in China
China Provinces.xml List of provinces in China
Cloud_providers.xml List of major public cloud providers
Countries.xml List of all countries in the world
Country telephone and iso codes.xml List of countries with their telephone codes.
Credit Card Companies.xml List of credit card networks
Cuisine.xml List of the different types of cuisines that people eat
Days of Month.xml List of days possible in a month
Days Of Week.xml List of days within a week
Elements.xml List of chemical elements
EPL Clubs.xml List of EPL Clubs(Season 22-23)
Gender.xml List of the possible gender options
Genre.xml List of the different genres of music
India Banks.xml List of all the banks running in India
India Top Cities.xml List of top cities in India
India State Codes.xml List of codes of States in India
India States.xml List of States in India
Months.xml List of all the possible months of a year
Moods.xml List of the different moods of people
Mumbai Localities.xml List of the localities of Mumbai
Olympic Countries.xml List of countries participating in the 2016 Olympics
Olympic Sports.xml List of the different sports being played in 2016 Olympics
Presidents.xml List of United states of America presidents
Seasons.xml List of the possible season of a year
Sex.xml List of different sex categories (You have a disgusting mind πŸ˜„)
Timezones.xml List of time zones
US State Codes.xml List of codes of States in the US
US States.xml List of States in the US
Weather.xml List of different weather conditions
world_cup_2022_groups.xml List of countries in Qatar 2022 world cup
world_spoken_languages.xml List of some world languages
Years.xml List of years from 1900 to 2050

Why String-Arrays?

String-Arrays are extremely flexible to use and it is very easy to use them in any data structure that we might like. Don't believe me? Fine let me prove it to you!

Copy the string array you want to use and place it in the res/values/some_file_name.xml file. It would look something like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="months">
        <item>January</item>
        .
        .
        .
    </string-array>
</resources>

Now to access this programmatically, we can do this:

//Get it in an array of strings
String[] months = getResources().getStringArray(R.array.months);

//Convert it into a list
List<String> monthsList = new ArrayList<String>();
    list = Arrays.asList(months);

You can also combine these string arrays for use in your apps. Let's say I want a key-value pair with the state codes as the key and the state names as the value. To implement this, I can do the following:

String[] us_state_codes = getResources().getStringArray(R.array.us_state_codes);


String[] us_state = getResources().getStringArray(R.array.us_states);

final Map<String, String> m = new HashMap<String, String>();

for(int i=0;i<us_state_codes.length();i++){
  m.put(us_state_codes[i],us_states[i]);
}

As you can see, this is a really flexible way to access data and can be used in various scenarios.

Note: This is extremely basic stuff but I wanted to show these examples for people who have not worked with string-arrays before.

Contributing

Please use the issue tracker to report any discrepancies in the data or any string-arrays you would like to see.

For contributions to this repo, fell free to send a pull request.

Credits

Author: Vinay Gaba ([email protected])

Follow me on Google+ Follow me on Twitter Follow me on LinkedIn

License

Copyright 2015 Vinay Gaba

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

More Repositories

1

Learn-Jetpack-Compose-By-Example

πŸš€ This project contains various examples that show how you would do things the "Jetpack Compose" way
Kotlin
2,910
star
2

CreditCardView

πŸ’³ CreditCardView is an Android library that allows developers to create the UI which replicates an actual Credit Card.
Java
786
star
3

RubberStamp

πŸ“« RubberStamp is an Android library that makes it easy for you to add a watermark to your images.
Java
417
star
4

JetpackCompose.app

πŸš€ The best source on the interwebs for all things Jetpack Compose!
TypeScript
76
star
5

Traveller

✈️ Add a map on your site with every place that you have visited!
HTML
22
star
6

Droidcon-SF-2019-Architecture-Agnostic-UI-Development

πŸ—οΈ Architecture Agnostic UI Development
Kotlin
7
star
7

SOS

This is an SOS application.The user has to enter a mobile number in the settings and save it. When the user presses the SOS button,the number that he entered gets an SMS with his current location.
Java
5
star
8

CopyCat

Save important texts/snippets in your Command Line! 😺
JavaScript
5
star
9

PAL

PAL: PDF Automation Language
OCaml
2
star
10

LetsHobee

Work In Progress
Java
2
star
11

BrailleIn2

An Android application made for the visually impaired which makes their life easy.
1
star
12

vinaygaba2.github.io

HTML
1
star
13

voice

It was used to test the Voice Recognition feature of android.The possible intrepretations of what the user spoke is displayed in a list.
Java
1
star
14

COMS-4771-Machine-Learning

Repo to have all the assignments that I wrote for the machine learning class
MATLAB
1
star
15

TextToAudio

A text to audio app.The user enters the text that he wants the app to speak.The pitch can be adjusted as well.
Java
1
star