This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Loop { | |
private static boolean isStarted = false; | |
private static Handler handler = new Handler(); | |
private static ConcreteActivity activity; | |
public static boolean isActive = true; | |
private static Runnable stepTimer = new Runnable() { | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.youtube.com/watch?v=ItUJ1iBVdf8 | |
https://github.com/iammert/FastGCM | |
https://github.com/kaushikgopal/RxJava-Android-Samples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String getQuery(String url, String field){ | |
String[] divider = url.split(field+"="); | |
String[] spliter = divider[1].split("&"); | |
return spliter[0]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.sointeractive.smartcity.service; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.support.annotation.NonNull; | |
import android.support.design.widget.Snackbar; | |
import android.util.Log; | |
import android.view.View; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":2060,"name":"Pizza Dracula","street":"Turystyczna","number":"2","plz":"31-213","telephone":"124312668","email":"[email protected]","locationName":"Kraków","locationId":9454,"stateId":6,"status":0,"isOnline":1,"isnew":false,"paymentbar":1,"preorder":"day","url":"pizza-dracula-krakow","onlycash":0,"specialComment":"Polaczenie uszkodzone, przlaczam na dyktowane","imageUrl":"https://image.yourdelivery.de/pyszne.pl/service/2060/Pizza+Dracula-0-0.jpg","ratingCount":1199,"ratingAdviceCount":1137,"ratingAverage":4.62,"tags":"Dania rybne, Dania z grilla, Pizza","openings":[{"from":"10:00","until":"22:30","day":0},{"from":"10:00","until":"22:30","day":1},{"from":"10:00","until":"22:30","day":2},{"from":"10:00","until":"22:30","day":3},{"from":"10:00","until":"22:30","day":4},{"from":"10:00","until":"22:30","day":5},{"from":"10:00","until":"22:30","day":6}],"openingSpecial":{},"mealTypes":null,"restaurantCategory":"Włoska","franchiseTypeId":1,"franchiseType":"normal","holidays":null,"sms":true,"favouriteCoun |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<TextView | |
android:id="@+id/draggable_list_swipe_item_stops_stop_name_data" | |
android:layout_width="100sp" | |
android:layout_height="wrap_content" | |
android:layout_marginLeft="@dimen/fragment_timetable_padding" | |
android:layout_marginTop="@dimen/fragment_text_margin" | |
android:text="@string/draggable_list_item_stops_stop_name" | |
android:textAppearance="?android:attr/textAppearanceMedium" | |
android:textColor="#e0000000" | |
android:singleLine="true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
compile 'com.android.support:appcompat-v7:22.2.1' | |
compile 'com.android.support:recyclerview-v7:22.2.1' | |
compile 'com.android.support:support-annotations:23.0.1' | |
compile 'com.squareup.retrofit:retrofit:1.9.0' | |
compile 'io.reactivex:rxandroid:0.25.0' | |
compile 'io.reactivex:rxjava:1.0.10' | |
compile 'io.reactivex:rxjava-math:0.21.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public int hashCode(){ | |
int result = 17; | |
result = 31 * result + someBoolean ? 1:0; | |
result = 31 * result + someByte; | |
result = 31 * result + someChar; | |
result = 31 * result + someShort; | |
result = 31 * result + someInt; | |
result = 31 * result + someLong ^ someLong >>> 32 ; | |
result = 31 * result + Float.floatToIntBits(someFloat); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Deserializer<T> implements JsonDeserializer<T> { | |
public abstract Class<T> setDestinationClass(); | |
@Override | |
public T deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { | |
Log.d("Deserializer", "deserialize json: " + json); | |
return new Gson().fromJson(json, setDestinationClass()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.http.NameValuePair; | |
import org.apache.http.client.HttpClient; | |
import org.apache.http.client.entity.UrlEncodedFormEntity; | |
import org.apache.http.client.methods.HttpPost; | |
import org.apache.http.impl.client.DefaultHttpClient; | |
import org.apache.http.message.BasicNameValuePair; | |
public class Request{ | |
public void post(String data){ |
OlderNewer