S
S
Sergey Semenko2016-10-30 17:45:08
Android
Sergey Semenko, 2016-10-30 17:45:08

Authorization in Android application?

Authorization on the server occurs by passing the API TOKEN in the Authorization header, i.e. no scopes, access tokens, etc., just one key.
Getting this key through the application is not a problem, I'm interested in options for storing it on the device, how and where to read the key when the application is restarted, etc.
It would be nice to find an example of such an application without any bells and whistles. SDK of various social media networks use a different system and it is appropriate to use the standard AccountManager there, but for my purposes it is not suitable (or maybe it is, write about it, if that).
The thought of storing the token using SharedPreferences immediately came to mind, but I can’t properly put everything together and write a stable system. Of course, I can write and read a line, but somehow this does not inspire confidence, I want a time-tested system.
Question: where can I find an example of a working application with source codes that works according to this authorization principle? Is there any good material on this topic?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2016-11-11
@skygliderus

See https://developer.android.com/samples/BasicAndroid...

D
display: block, 2017-01-03
@qork

The period does not capture the line break (\n or \r\n) and most likely (I don’t know what delimiters the regular expression is wrapped in) you need to escape the slash in the closing tag with a backslash.

Y
Yuri Prosto, 2017-01-03
@hyurka

StringRegExp($linkRead, '(?:<ul>)(\n.*\n)(?:<\/ul>)', 3)
doesn't work either

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question