Commit 63aaa1b3 authored by Bruno Agrizzi's avatar Bruno Agrizzi

TimeStamp 🕙 and Storage data 📂 implemented

parent 64874c88
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
build/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
*.log
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
# Keystore files
*.jks
BluetoothEvologica
\ No newline at end of file
BluetoothReceiver
\ No newline at end of file
......@@ -3,13 +3,19 @@
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="distributionType" value="LOCAL" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="1.8" />
<option name="gradleHome" value="C:\Program Files\Android\android-studio\gradle\gradle-2.10" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/Application" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="myModules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
......
......@@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Application/Application.iml" filepath="$PROJECT_DIR$/Application/Application.iml" />
<module fileurl="file://$PROJECT_DIR$/BluetoothEvologica.iml" filepath="$PROJECT_DIR$/BluetoothEvologica.iml" />
<module fileurl="file://$PROJECT_DIR$/BluetoothReceiver.iml" filepath="$PROJECT_DIR$/BluetoothReceiver.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.brunoagrizzi.evologicabt"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
}
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Program Files (x86)\Android\android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
package com.example.brunoagrizzi.evologicabt;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.brunoagrizzi.evologicabt">
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="@android:drawable/sym_action_chat"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DataListener">
<intent-filter>
<action android:name="android.bluetooth.device.action.ACL_CONNECTED" />
<action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" />
</intent-filter>
</activity>
</application>
</manifest>
package com.example.brunoagrizzi.evologicabt;
/**
* Created by brunoagrizzi on 05/04/2016.
*/
public interface Constants {
// Message types sent from the BluetoothService Handler
public static final int MESSAGE_STATE_CHANGE = 1;
public static final int MESSAGE_READ = 2;
public static final int MESSAGE_WRITE = 3;
public static final int MESSAGE_DEVICE_NAME = 4;
public static final int MESSAGE_TOAST = 5;
// Key names received from the BluetoothService Handler
public static final String DEVICE_NAME = "device_name";
public static final String TOAST = "toast";
}
package com.example.brunoagrizzi.evologicabt;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Set;
import java.util.UUID;
import com.example.brunoagrizzi.evologicabt.DataStorage;
/**
* Created by brunoagrizzi on 05/04/2016.
*/
public class DataListener extends AppCompatActivity {
private static final int REQUEST_ENABLE_BT = 3;
public static final String MY_PREFS_NAME = "MyUUID";
private static final String TAG = "DataListener";
private StringBuffer mOutStringBuffer;
private ListView mListView;
private String mConnectedDeviceName = null;
private BluetoothAdapter mBluetoothAdapter = null;
private Set<BluetoothDevice> pairedDevices;
private BluetoothThreadManager mService = null;
private ArrayAdapter<String> mArrayAdapter;
ArrayList<HashMap<String,String>> mMensagens;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_dados);
mListView = (ListView)findViewById(R.id.list);
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
initialService();
findDevice();
}
public void findDevice(){
pairedDevices = mBluetoothAdapter.getBondedDevices();
Iterator<BluetoothDevice> it = pairedDevices.iterator();
while(it.hasNext()) {
BluetoothDevice bt = it.next();
if (bt.getName().equalsIgnoreCase(getIntent().getStringExtra("dispositivo"))) {
String address = bt.getAddress();
BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(address);
mService.connect(device, true);
return;
}
}
}
@Override
public void onStart() {
super.onStart();
if (!mBluetoothAdapter.isEnabled()) {
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
} else if (mService == null) {
initialService();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (mService != null) {
mService.stop();
}
}
@Override
public void onResume() {
super.onResume();
if (mService != null) {
if (mService.getState() == BluetoothThreadManager.STATE_NONE) {
mService.start();
}
}
}
private void initialService() {
mMensagens = new ArrayList<HashMap<String,String>>();
//mArrayAdapter = new ArrayAdapter<String>(DataListener.this, R.layout.message);
//mArrayAdapter = new ArrayAdapter<String>(DataListener.this,android.R.layout.simple_list_item_1);
//mListView.setAdapter(mArrayAdapter);
mService = new BluetoothThreadManager(DataListener.this, mHandler,UUID.fromString(getIntent().getStringExtra("UUID")));
saveUUID(getIntent().getStringExtra("UUID"));
mOutStringBuffer = new StringBuffer("");
}
private final Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case Constants.MESSAGE_STATE_CHANGE:
switch (msg.arg1) {
case BluetoothThreadManager.STATE_CONNECTED:
//mArrayAdapter.clear();
mMensagens.clear();
}
break;
case Constants.MESSAGE_WRITE:
byte[] writeBuf = (byte[]) msg.obj;
String writeMessage = new String(writeBuf);
mArrayAdapter.add("Me: " + writeMessage);
break;
case Constants.MESSAGE_READ:
byte[] readBuf = (byte[]) msg.obj;
HashMap<String, String> mMsg = new HashMap<String, String>();
//String readMessage = new String(readBuf, 0, msg.arg1);
//mArrayAdapter.add(mConnectedDeviceName + ": " + readMessage);
String[] from = new String[]{"content", "timestamp"};
int[] to = new int[]{R.id.text1,R.id.text2};
mMsg.put("content",mConnectedDeviceName + ": " + toHexString(readBuf,msg.arg1));
DateFormat timestamp = new SimpleDateFormat("HH:mm:ss.SSS");
Date hora = Calendar.getInstance().getTime();
mMsg.put("timestamp",timestamp.format(hora));
mMensagens.add(mMsg);
SimpleAdapter simpleAdapter = new SimpleAdapter(DataListener.this,mMensagens,R.layout.message,from,to);
mListView.setAdapter(simpleAdapter);
//mArrayAdapter.add(mConnectedDeviceName + ": " + toHexString(readBuf,msg.arg1));
break;
case Constants.MESSAGE_DEVICE_NAME:
mConnectedDeviceName = msg.getData().getString(Constants.DEVICE_NAME);
if (null != DataListener.this) {
Toast.makeText(DataListener.this, "Connected to "
+ mConnectedDeviceName, Toast.LENGTH_SHORT).show();
}
break;
case Constants.MESSAGE_TOAST:
if (null != DataListener.this) {
Toast.makeText(DataListener.this, msg.getData().getString(Constants.TOAST),
Toast.LENGTH_SHORT).show();
}
break;
}
}
};
public String toHexString(byte[] bytes, int num)
{
final char[] HEX_CHARS = {
'0', '1', '2' ,'3', '4', '5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F'
};
StringBuilder sb = new StringBuilder();
for(int i = 0; i < bytes.length && i < num; i++) {
byte b = bytes[i];
sb.append(new char[] {HEX_CHARS[(b >> 4) & 0x0f], HEX_CHARS[b & 0x0f]});
sb.append(" ");
}
return sb.toString();
}
public void saveUUID(String value){
SharedPreferences.Editor editor = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE).edit();
editor.putString("UUID", value);
editor.commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
//Exporta dados
DataStorage msgStore = new DataStorage();
String responseData = "";
for (HashMap msg: mMensagens) {
String[] content = msg.get("content").toString().split(":");
responseData = responseData + msg.get("timestamp").toString() + "\t";
responseData = responseData + content[1] + "\n";
}
String[] initial = mMensagens.get(0).get("timestamp").toString().split(":");
String dataInitial = initial[0]+"_"+initial[1]+"_"+initial[2];
String[] finaly = mMensagens.get(mMensagens.size()-1).get("timestamp").toString().split(":");
String dataFinaly = finaly[0]+"_"+finaly[1]+"_"+finaly[2];
msgStore.salvarExternalStorage(responseData,mConnectedDeviceName,dataInitial + "-" + dataFinaly);
Toast.makeText(DataListener.this, "Storage success" , Toast.LENGTH_SHORT).show();
return true;
}
return super.onOptionsItemSelected(item);
}
}
package com.example.brunoagrizzi.evologicabt;
import android.os.Environment;
import android.util.Log;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.ObjectOutputStream;
/**
* Created by brunoagrizzi on 28/04/2016.
*/
public class DataStorage {
boolean mExternalStorageAvailable = false;
boolean mExternalStorageWriteable = false;
public void salvarExternalStorage(String text,String nameDir,String nameArq) {
// Obtém o estado do storage.
String mediaState = Environment.getExternalStorageState();
// Testa se ele está disponível.
if (mediaState.equals(Environment.MEDIA_MOUNTED)) {
FileWriter fileWriter = null;
try {
// Cria o arquivo onde serão salvas as informações.
File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS + File.separator + nameDir);
if (!dir.exists())
dir.mkdirs();
File file = new File(dir, nameArq+".txt");
fileWriter = new FileWriter(file, true);
Please register or sign in to reply
fileWriter.append(text);
//fileWriter.append("/n");// Quebra de linha.
//fileWriter.append(String.valueOf(numero));
// Escreve no arquivo.
fileWriter.flush();
} catch (IOException e) {
Log.e("Erros", "Erro ao salvar usando External Storage", e);
} finally {
// Fecha os recursos.
if (fileWriter != null) {
try {fileWriter.close();}
catch(Exception e){}
}
}
}
}
public void checkStorage() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
// Podemos ler e escrever os meios de comunicação
mExternalStorageAvailable = mExternalStorageWriteable = true;
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
// Só podemos ler a mídia
mExternalStorageAvailable = true;
mExternalStorageWriteable = false;
} else {
// Outra coisa que está errada. Pode ser um de muitos outros estados, mas tudo o que precisamos
// Para saber é que não sabem ler nem escrever
mExternalStorageAvailable = mExternalStorageWriteable = false;
}
}
}
package com.example.brunoagrizzi.evologicabt;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Set;
public class MainActivity extends AppCompatActivity {
Button b1,b2,b3,b4;
private BluetoothAdapter BA;
private Set<BluetoothDevice> pairedDevices;
ListView lv;
public static final String MY_PREFS_NAME = "MyUUID";
private TextView modelEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1 = (Button) findViewById(R.id.button);
b2=(Button)findViewById(R.id.button2);
b3=(Button)findViewById(R.id.button3);
b4=(Button)findViewById(R.id.button4);
BA = BluetoothAdapter.getDefaultAdapter();
lv = (ListView)findViewById(R.id.listView);
modelEditText = (TextView) findViewById(R.id.modeledittext);
}
public void on(View v){
if (!BA.isEnabled()) {
Intent turnOn = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(turnOn, 0);
Toast.makeText(getApplicationContext(), "Turned on", Toast.LENGTH_LONG).show();
}
else
{
Toast.makeText(getApplicationContext(),"Already on", Toast.LENGTH_LONG).show();
}
}
public void off(View v){
BA.disable();
Toast.makeText(getApplicationContext(),"Turned off" ,Toast.LENGTH_LONG).show();
}
public void visible(View v){
Intent getVisible = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);
startActivityForResult(getVisible, 0);
}
public void list(View v){
pairedDevices = BA.getBondedDevices();
ArrayList list = new ArrayList();
for(BluetoothDevice bt : pairedDevices)
list.add(bt.getName());
Toast.makeText(getApplicationContext(),"Showing Paired Devices",Toast.LENGTH_SHORT).show();
final ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_list_item_1, list);
lv.setAdapter(adapter);
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
showInputDialog(v);
/*Intent intent = new Intent(MainActivity.this, DataListener.class);
intent.putExtra("dispositivo", ((TextView) view).getText().toString());
startActivity(intent);*/
}
});
}
protected void showInputDialog(final View v) {
LayoutInflater layoutInflater = LayoutInflater.from(MainActivity.this);
View promptView = layoutInflater.inflate(R.layout.input_dialog, null);
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(MainActivity.this);
alertDialogBuilder.setView(promptView);
final EditText editText = (EditText) promptView.findViewById(R.id.modeledittext);
editText.setText(loadUUID());
// setup a dialog window
alertDialogBuilder.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(MainActivity.this, DataListener.class);
intent.putExtra("dispositivo", ((TextView) v).getText().toString());
intent.putExtra("UUID", editText.getText().toString());
startActivity(intent);
}
})
.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
// create an alert dialog
AlertDialog alert = alertDialogBuilder.create();
alert.show();
}
public String loadUUID(){
SharedPreferences prefs = getSharedPreferences(MY_PREFS_NAME, MODE_PRIVATE);
String uuid = prefs.getString("UUID","fa87c0d0-afac-11de-8a39-0800200c9a66");
return uuid;
}
/*@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}*/
}
package com.example.brunoagrizzi.evologicabt;
/**
* Created by brunoagrizzi on 28/04/2016.
*/
public class Message {
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/list"
android:layout_gravity="center_horizontal" />
</LinearLayout>
\ No newline at end of file
<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:transitionGroup="true">
<!--<TextView android:text="@string/app_name" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textview"
android:textSize="35dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />-->
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Turn On"
android:id="@+id/button"
android:clickable="true"
android:onClick="on"
android:layout_alignParentTop="true"
android:layout_toStartOf="@+id/textView2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Get visible"
android:onClick="visible"
android:id="@+id/button2"
android:layout_below="@+id/button3"
android:layout_alignEnd="@+id/button3"
android:layout_toEndOf="@+id/button4"
android:layout_alignStart="@+id/button3" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List devices"
android:onClick="list"
android:id="@+id/button3"
android:layout_alignParentTop="true"
android:layout_toEndOf="@+id/textView2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="turn off"
android:onClick="off"
android:id="@+id/button4"
android:layout_above="@+id/textView2"
android:layout_alignStart="@+id/button" />
<ListView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/listView"
android:layout_alignParentBottom="true"
android:layout_below="@+id/textView2"
android:focusable="false" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Paired devices:"
android:id="@+id/textView2"
android:textColor="#02068c"
android:textSize="25dp"
android:layout_below="@+id/button2"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="UUID:"
android:id="@+id/modeltext" />
<EditText
android:id="@+id/modeledittext"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Enter UUID here.."
android:padding="10dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Medium Text"
android:id="@+id/text1"
android:layout_marginLeft="5dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="Small Text"
android:id="@+id/text2"
android:layout_gravity="right"
android:textColor="@color/colorPrimary"
android:layout_marginRight="5dp" />
</LinearLayout>
\ No newline at end of file
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="Export Data"
app:showAsAction="never"/>
</menu>
\ No newline at end of file
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
<resources>
<string name="app_name">EvologicaBT</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
package com.example.brunoagrizzi.evologicabt;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
#Wed Apr 10 15:27:10 PDT 2013
#Mon Apr 11 13:30:08 BRT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
......@@ -42,11 +42,6 @@ case "`uname`" in
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
......@@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
cd "$SAVED" >/dev/null
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
......@@ -114,6 +109,7 @@ fi
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
......
include 'Application'
include ':app'
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment