Skip to content

Use resource files for strings. #4

@doncung

Description

@doncung

In your Twitter class there are some hardcoded strings for converting a date to a string. Remember to use string resource files instead of hardcoding strings like this. In the future you may want your app to be translated or you could potentially change the strings to display based on if the device is in landscape mode. As such you generally never want to hardcode a user visible string. (It's fine for logging or internal usage).
Also just for your information there are some Android classes that can do this sort of conversion of a time/date to string which may be easier in the future (though maybe here you needed something more specific):
https://developer.android.com/reference/android/text/format/DateUtils#getRelativeDateTimeString(android.content.Context,%20long,%20long,%20long,%20int)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions