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 ContactAdapter extends | |
RecyclerView.Adapter<ContactAdapter.ContactViewHolder> { | |
private List<ContactInfo> contactList; | |
public ContactAdapter(List<ContactInfo> contactList) { | |
this.contactList = contactList; | |
} | |
@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
public static class ContactViewHolder extends RecyclerView.ViewHolder { | |
protected TextView vName; | |
protected TextView vSurname; | |
protected TextView vEmail; | |
protected TextView vTitle; | |
public ContactViewHolder(View v) { | |
super(v); | |
vName = (TextView) v.findViewById(R.id.txtName); | |
vSurname = (TextView) v.findViewById(R.id.txtSurname); |
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 ContactInfo { | |
protected String name; | |
protected String surname; | |
protected String email; | |
protected static final String NAME_PREFIX = "Name_"; | |
protected static final String SURNAME_PREFIX = "Surname_"; | |
protected static final String EMAIL_PREFIX = "email_"; | |
} |
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
<android.support.v7.widget.CardView | |
xmlns:card_view="http://schemas.android.com/apk/res-auto" | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/card_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
card_view:cardCornerRadius="4dp" | |
android:layout_margin="5dp"> | |
<RelativeLayout | |
android:layout_width="match_parent" |
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 | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_my); | |
RecyclerView recList = (RecyclerView) findViewById(R.id.cardList); | |
recList.setHasFixedSize(true); | |
LinearLayoutManager llm = new LinearLayoutManager(this); | |
llm.setOrientation(LinearLayoutManager.VERTICAL); | |
recList.setLayoutManager(llm); | |
} |
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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
tools:context=".MyActivity"> | |
<android.support.v7.widget.RecyclerView |
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 void doRequest() { | |
initClient(); | |
Request req = new Request.Builder() | |
.url(URL) | |
.get() | |
.build(); | |
client.newCall(req).enqueue(new Callback() { | |
@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
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" | |
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" | |
android:paddingRight="@dimen/activity_horizontal_margin" | |
android:paddingTop="@dimen/activity_vertical_margin" | |
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"> | |
<android.support.v7.widget.Toolbar | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" |
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
void loop() { | |
EthernetClient client = server.available(); // Is there a client (Our Android smartphone) | |
// Read temp | |
int sensorVal = analogRead(3); | |
float vSens = (sensorVal /1024.0) * 5.0; | |
//Serial.println(vSens); | |
float temp = (vSens - 0.5) * 100; |
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
<proxy name="AndroidService" | |
transports="https http" | |
startOnLoad="true" | |
trace="disable" | |
statistics="enable"> | |
<description/> | |
<target> | |
<inSequence> | |
<log> | |
<property name="Message Flow" value="Arduino API"/> |
NewerOlder