Skip to content

Commit dfe475c

Browse files
author
eyazici
committed
bug fixes
1 parent 6e84f2d commit dfe475c

File tree

9 files changed

+45
-92
lines changed

9 files changed

+45
-92
lines changed

androidapp/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ dependencies {
5656
//firabase
5757
implementation 'com.google.firebase:firebase-core:17.0.0'
5858
implementation 'com.google.firebase:firebase-database:17.0.0'
59+
//user manual in help
60+
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
5961
}
6062

6163
buildscript {

androidapp/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
88
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
99
<uses-permission android:name="android.permission.INTERNET" />
10-
10+
<!-- need to add user manual -->
11+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
1112
<permission
1213
android:name="android.permission.BLUETOOTH"
1314
android:label="BLUETOOTH" />
561 KB
Binary file not shown.

androidapp/app/src/main/java/com/cantech/cannect/Contact.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ protected void onCreate(Bundle savedInstanceState) {
4242
.addItem(new Element().setTitle("Version 1.0"))
4343
.addGroup("CONNECT WITH US!")
4444
.addEmail("Your mail id ")
45-
.addGitHub("link to source code")
46-
.addWebsite("Your website/")
45+
.addGitHub("https://csil-git1.cs.surrey.sfu.ca/capstone-1194-group-8/ensc-405w")
46+
.addWebsite("http://www.sfu.ca/~eyazici/#home")
4747
.addYoutube("https://www.youtube.com/watch?v=w_xi4uaV3mE&feature=youtu.be&ab_channel=PoCDemosSummer2020") //Enter your youtube link here (replace with my channel link)
4848
.addPlayStore("com.cantech.cannect") //Replace all this with your package name
4949
.addItem(createCopyright())

androidapp/app/src/main/java/com/cantech/cannect/Help.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
import android.os.Bundle;
77

8+
import com.github.barteksc.pdfviewer.PDFView;
9+
810
public class Help extends AppCompatActivity {
11+
PDFView mpdfView;
912
SharedPref sharedPref;
1013
@Override
1114
protected void onCreate(Bundle savedInstanceState) {
@@ -20,6 +23,9 @@ protected void onCreate(Bundle savedInstanceState) {
2023
super.onCreate(savedInstanceState);
2124
setContentView(R.layout.activity_help);
2225

26+
mpdfView = (PDFView) findViewById(R.id.pdfView);
27+
mpdfView.fromAsset("User Manual.pdf").load();
28+
2329
getSupportActionBar().setTitle("Help");
2430
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
2531
}

androidapp/app/src/main/java/com/cantech/cannect/Preferences.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@
22

33
import androidx.appcompat.app.AppCompatActivity;
44
import androidx.appcompat.app.AppCompatDelegate;
5+
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
56

7+
import android.content.Intent;
68
import android.os.Bundle;
9+
import android.util.Log;
710
import android.widget.CompoundButton;
811
import android.widget.Switch;
912

1013
public class Preferences extends AppCompatActivity {
1114
SharedPref sharedPref;
1215
private Switch theme_switch;
16+
boolean flag;
17+
String BTSensor;
1318
@Override
1419
protected void onCreate(Bundle savedInstanceState) {
1520
//load saved theme state
@@ -41,4 +46,25 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean b) {//b is b
4146
}
4247
});
4348
}
49+
50+
private void sendPID2BT(){
51+
final Intent sendingMessageIntent = new Intent("sendingMessage");
52+
Thread t = new Thread(){
53+
public void run() {
54+
while (true) {
55+
sendingMessageIntent.putExtra("theMessage", "31 ");
56+
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(sendingMessageIntent);
57+
try {
58+
Thread.sleep(1500);
59+
} catch (InterruptedException e) {
60+
// TODO Auto-generated catch block
61+
e.printStackTrace();
62+
}
63+
if (flag){
64+
break;}
65+
}
66+
}
67+
};
68+
t.start();
69+
}
4470
}

androidapp/app/src/main/res/layout/activity_about.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
<TextView
3636
android:layout_width="match_parent"
3737
android:layout_height="wrap_content"
38-
android:text="This app was developed by capstone students working in Cantech.
39-
Cannect does not store or collect any personal data. This product is licensed under C."
38+
android:text="Our team at CANtech is introducing an open source hardware and software platform called CANnect that allows consumers to view car diagnostics and track the maintenance of their vehicle. CANnect is a combination of a CAN Bus reader that can be connect to the OBD-II port of the vehicle, and a mobile application that receives this vehicle data through a Bluetooth connection. Our product being open source allows consumers to customize our base features to meet their needs and introduce new solutions to our platform."
4039
android:textColor="?attr/textcolor"
4140
android:layout_marginTop="8dp"/>
4241
</LinearLayout>
Lines changed: 5 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
xmlns:tools="http://schemas.android.com/tools"
55
android:layout_width="match_parent"
66
android:layout_height="match_parent"
77
tools:context=".Help">
88

9-
<androidx.cardview.widget.CardView
10-
app:cardBackgroundColor="?attr/cardBackground"
9+
<com.github.barteksc.pdfviewer.PDFView
10+
android:id="@+id/pdfView"
1111
android:layout_width="match_parent"
12-
android:layout_height="wrap_content">
13-
<LinearLayout
14-
android:layout_width="match_parent"
15-
android:layout_height="match_parent"
16-
android:padding="10dp"
17-
android:orientation="vertical">
18-
<TextView
19-
android:textColor="?attr/textcolor"
20-
android:textStyle="bold"
21-
android:text="Compatibility"
22-
android:layout_width="wrap_content"
23-
android:layout_height="wrap_content"/>
24-
<TextView
25-
android:layout_width="match_parent"
26-
android:layout_height="wrap_content"
27-
android:text="Use the same reader code as the method for sending the data may vary between devices. Do not use other adapters.
28-
Cannect is compatible with OBDII compliant cars. Most of modern cars are OBDII comlaint. Cannect reader module, and the software
29-
app was tested with a Toyota car and verified its functionality. However, we cannot guarantee correct connetion with other cars."
30-
android:textColor="?attr/textcolor"
31-
android:layout_marginTop="8dp"/>
32-
</LinearLayout>
12+
android:layout_height="436dp"/>
3313

34-
<LinearLayout
35-
android:layout_width="match_parent"
36-
android:layout_height="match_parent"
37-
android:padding="10dp"
38-
android:layout_marginTop="200dp"
39-
android:orientation="vertical">
40-
<TextView
41-
android:textColor="?attr/textcolor"
42-
android:textStyle="bold"
43-
android:text="Diagnostics error codes"
44-
android:layout_width="wrap_content"
45-
android:layout_height="wrap_content"/>
46-
<TextView
47-
android:layout_width="match_parent"
48-
android:layout_height="wrap_content"
49-
android:text="OBD is short for onboard diagnostics. It refers to a vehicle's electronic system that performs self-diagnosis and reporting. Whenever a problem is detected the system records it as a unique code. That code is known as a diagnostic trouble code (DTC)."
50-
android:textColor="?attr/textcolor"
51-
android:layout_marginTop="8dp"/>
52-
</LinearLayout>
53-
54-
<LinearLayout
55-
android:layout_width="match_parent"
56-
android:layout_height="match_parent"
57-
android:padding="10dp"
58-
android:layout_marginTop="400dp"
59-
android:orientation="vertical">
60-
<TextView
61-
android:textColor="?attr/textcolor"
62-
android:textStyle="bold"
63-
android:text="Diagnostics Tests"
64-
android:layout_width="wrap_content"
65-
android:layout_height="wrap_content"/>
66-
<TextView
67-
android:layout_width="match_parent"
68-
android:layout_height="wrap_content"
69-
android:text="Instead of doing a tailpipe emissions check on a dynamometer, an OBD II check is a simple plug-in test that takes only seconds.The Malfunction Indicator Lamp (MIL), which may be labeled Check Engine or Service Engine Soon or a symbol of an engine with the word Check in the middle, is supposed to alert the driver when a problem occurs. Depending on how the system is configured and the nature of the problem, the lamp may come on and go off, remain on continuously or flash - all of which can be very confusing to the motorist because he has no way of knowing what the light means. Is it a serious problem or not? If the engine seems to be running okay, the motorist may simply ignore the light. With OBD II, the Check Engine light will come on only for emissions-related failures. A separate warning light must be used for other non-emissions problems such as low oil pressure, charging system problems, etc."
70-
android:textColor="?attr/textcolor"
71-
android:layout_marginTop="8dp"/>
72-
</LinearLayout>
73-
74-
<LinearLayout
75-
android:layout_width="match_parent"
76-
android:layout_height="match_parent"
77-
android:padding="10dp"
78-
android:layout_marginTop="800dp"
79-
android:orientation="vertical">
80-
<TextView
81-
android:textColor="?attr/textcolor"
82-
android:textStyle="bold"
83-
android:text="Dashboard"
84-
android:layout_width="wrap_content"
85-
android:layout_height="wrap_content"/>
86-
<TextView
87-
android:layout_width="match_parent"
88-
android:layout_height="wrap_content"
89-
android:text="Data logging is the ability to view all major parameters that relate to engine operation. ... It will also allow you to monitor all the engine vitals (sensor information like fuel pressure, oil pressure, knock sensor, etc). OBD2 data lets you e.g. monitor/optimize driving behavior and tune your car. OEMs can use the data to analyze the performance of new prototype parts in the field"
90-
android:textColor="?attr/textcolor"
91-
android:layout_marginTop="8dp"/>
92-
</LinearLayout>
93-
</androidx.cardview.widget.CardView>
94-
95-
</ScrollView>
14+
</RelativeLayout>

androidapp/app/src/main/res/layout/activity_preferences.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
android:id="@+id/autoBT_switch"
122122
android:layout_width="match_parent"
123123
android:layout_height="wrap_content"
124-
android:text="Connect Automatically"
124+
android:text="Connect Sensor Module"
125125
android:textColor="?attr/textcolor"
126126
android:layout_marginTop="8dp"/>
127127
</LinearLayout>

0 commit comments

Comments
 (0)