halu5071 / git-push-hackathon Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ca-archived/git-push-hackathon
$ git push hackathon :computer:
Home Page: https://www.cyberagent.co.jp/
This project forked from ca-archived/git-push-hackathon
$ git push hackathon :computer:
Home Page: https://www.cyberagent.co.jp/
and add dependency of android.arch.lifecycle:reactivestreams
to convert Observable to LiveData
set auth token on header from NetworkModule
This is my etude.
first I will list up libraries I will use and try to use
And I adopt Clean Architecture.
usecase package is (probably) my original. In Android-CleanArchitecture
repository, usecase is, for example, GetUserDetail.java
. I mean the usecase class has a just only one operation. However, in my project, usecase classes are small, and have basic CRUD. So my usecase classes have some operations.
rely on AngularJS DEVELOPERS
try it
In AuthDataDataRepository, I use OkHttp to fetch access token, but it is consistent.
after merging #19
Just try it.
It is a first time to write ProGuard!!
implement Login flow
CustomTab
Activity must not know that this app using Dagger injection.
「何によって提供されてるかは、提供される側が考えることじゃない」
— halu5071 (@halu5071) 2018年2月12日
fetch user data, that's all
based on #56 , I will remove AuthDataUseCase
.
thus, AuthDataDataRepository
has authData
emoji coming
com.android.support:support-emoji:27.0.2
or
com.android.support:support-emoji-bundled:27.0.2
https://developer.android.com/guide/topics/ui/look-and-feel/emoji-compat.html
When I adopt Clean-Architecture
, I would have used UseCase
to operate Repository
. However, after I learned MVVM (and Architecture Component, DataBinding), UseCase
classes are redundant I think.
hmmm
TBD
implement a basis of DI, using Dagger2
AppInjector
|
AppComponent - AppModule
|- MainActivityComponent - MainActivityModule (Subcomponent)
|- etc
In some resources, I want to use pagination which needs Link
header. So It must contains raw response.
Pagination object must manage in some instance.
Events
which contains Event
objects as List have pagination objectEventUseCase
manage pagination objectTBD
[UPDATED 2018/2/5]
After reading this book
Android Architecture Components has android.arch.paging
Library (it is alpha version).
I do not know it exactly, but it may be useful. TBD
add dependencies for test.
For example, the return value from Retrofit must be mocked up without network responses.
Design
moshi can create enum class
when read blank value and convert Json via moshi, app crashed.
moshi can not convert blank to null
now AuthDataUseCase
convert JSON to AuthData, but this is not desirable. AuthDataRepository
(and the implementation class) have a responsibility to generate AuthData.
NowAuthDataRepository#get()
returns String
. However, from this issue, AuthDataRepository#get()
returns AuthData?
can read file from resources
on data
layer
CRUD on domain
Layer
Ooooops!!
OAuth callback url will change when ClientID changes.
So, redirect_host
and redirect_schema
should be replaced by environment variants
After #56
add entity test.
read json from resource
directory.
Now I use raw OkHttp to fetch access token, but it is redundant.
Need Retrofit convertor factory to get String data
ca-archived#8 (comment)
Roger!!
But I will use event
API.
I know that I can fetch event data from https://github.com/:username
in atom style after putting Accept: application/atom+xml
header, but It is redundant.
because in Android (or iOS) program, atom style xml is not useful but JSON is a common way to represent some data from the server.
/users/:username/received_events
implement SwipeToRefresh
There are various payloads on event data, so moshi can not parse them by default.
I will create a custom json adapter for each payloads.
Fortunately, I have learned to make custom json adapter in my post
type
fieldcache event data on EventCache.kt of data layer.
It means event data exist Remote and Local.
EventDataRepository decide from which resource should read.
on domain
layer
In this app, data
layer does not have entity package, because both data
and domain
layer will use the same entities, and data
layer can use entities on domain
layer
Add Test
on presentation
and data
layer
data
layer
NetworkModule which provides okhttp, retrofit and retrofit service
presentation
layer
AppModule which provides context and concrete instance of Repository on data
layer
Android-KTX coming. So I will replace code of SharedPreferences with KTX.
https://android-developers.googleblog.com/2018/02/introducing-android-ktx-even-sweeter.html
add dependency for Glide
on AuthDataDataSource
[UPDATED]
https://developer.android.com/training/articles/keystore.html#SupportedAlgorithms
RSA/ECB/OAEPWithSHA-256AndMGF1Padding
Event
I know there is org.eclipse.egit.github.core
, but that library use gson
and some other redundant class contains, and some field is not enough. So I will not use the library
I realized some @Inject
annotation is unnecessary. Remove it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.