mirror of
https://github.com/imcarlost/Android-Itunes-API.git
synced 2026-04-10 10:56:54 -04:00
Initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.hakodev.androiditunesapi;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import pro.oncreate.easynet.EasyNet;
|
||||
import pro.oncreate.easynet.models.NResponseModel;
|
||||
|
||||
public class AndroidItunesAPI extends Application {
|
||||
|
||||
private static Application instance = null;
|
||||
|
||||
public static Application getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
instance = this;
|
||||
EasyNet.getInstance()
|
||||
.setWriteLogs(false)
|
||||
.setDefaultRequestListener(request -> request.setHost("http://192.168.1.151:25555/BeamNGTelemetry"))
|
||||
.addOnErrorDefaultListener(new EasyNet.OnErrorDefaultListenerWithCode(404) {
|
||||
@Override
|
||||
public void onError(NResponseModel responseModel) {
|
||||
// For example, intercepted error 404
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.hakodev.androiditunesapi.activities;
|
||||
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.hakodev.androiditunesapi.R;
|
||||
|
||||
public class ArtistListActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setupTheme();
|
||||
setContentView(R.layout.activity_main);
|
||||
}
|
||||
|
||||
private void setupTheme() {
|
||||
setTheme(R.style.AppTheme);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
|
||||
package com.hakodev.androiditunesapi.models;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Artist {
|
||||
|
||||
@SerializedName("resultCount")
|
||||
@Expose
|
||||
private Long resultCount;
|
||||
@SerializedName("results")
|
||||
@Expose
|
||||
private List<Result> results = null;
|
||||
|
||||
public Long getResultCount() {
|
||||
return resultCount;
|
||||
}
|
||||
|
||||
public void setResultCount(Long resultCount) {
|
||||
this.resultCount = resultCount;
|
||||
}
|
||||
|
||||
public List<Result> getResults() {
|
||||
return results;
|
||||
}
|
||||
|
||||
public void setResults(List<Result> results) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
|
||||
package com.hakodev.androiditunesapi.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Result {
|
||||
|
||||
@SerializedName("wrapperType")
|
||||
@Expose
|
||||
private String wrapperType;
|
||||
@SerializedName("artistType")
|
||||
@Expose
|
||||
private String artistType;
|
||||
@SerializedName("artistName")
|
||||
@Expose
|
||||
private String artistName;
|
||||
@SerializedName("artistLinkUrl")
|
||||
@Expose
|
||||
private String artistLinkUrl;
|
||||
@SerializedName("artistId")
|
||||
@Expose
|
||||
private Long artistId;
|
||||
@SerializedName("amgArtistId")
|
||||
@Expose
|
||||
private Long amgArtistId;
|
||||
@SerializedName("primaryGenreName")
|
||||
@Expose
|
||||
private String primaryGenreName;
|
||||
@SerializedName("primaryGenreId")
|
||||
@Expose
|
||||
private Long primaryGenreId;
|
||||
|
||||
public String getWrapperType() {
|
||||
return wrapperType;
|
||||
}
|
||||
|
||||
public void setWrapperType(String wrapperType) {
|
||||
this.wrapperType = wrapperType;
|
||||
}
|
||||
|
||||
public String getArtistType() {
|
||||
return artistType;
|
||||
}
|
||||
|
||||
public void setArtistType(String artistType) {
|
||||
this.artistType = artistType;
|
||||
}
|
||||
|
||||
public String getArtistName() {
|
||||
return artistName;
|
||||
}
|
||||
|
||||
public void setArtistName(String artistName) {
|
||||
this.artistName = artistName;
|
||||
}
|
||||
|
||||
public String getArtistLinkUrl() {
|
||||
return artistLinkUrl;
|
||||
}
|
||||
|
||||
public void setArtistLinkUrl(String artistLinkUrl) {
|
||||
this.artistLinkUrl = artistLinkUrl;
|
||||
}
|
||||
|
||||
public Long getArtistId() {
|
||||
return artistId;
|
||||
}
|
||||
|
||||
public void setArtistId(Long artistId) {
|
||||
this.artistId = artistId;
|
||||
}
|
||||
|
||||
public Long getAmgArtistId() {
|
||||
return amgArtistId;
|
||||
}
|
||||
|
||||
public void setAmgArtistId(Long amgArtistId) {
|
||||
this.amgArtistId = amgArtistId;
|
||||
}
|
||||
|
||||
public String getPrimaryGenreName() {
|
||||
return primaryGenreName;
|
||||
}
|
||||
|
||||
public void setPrimaryGenreName(String primaryGenreName) {
|
||||
this.primaryGenreName = primaryGenreName;
|
||||
}
|
||||
|
||||
public Long getPrimaryGenreId() {
|
||||
return primaryGenreId;
|
||||
}
|
||||
|
||||
public void setPrimaryGenreId(Long primaryGenreId) {
|
||||
this.primaryGenreId = primaryGenreId;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user