diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
index 30039a6..2f8c48e 100644
Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index afd5428..f9612a7 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -2,6 +2,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/java/team3/kau/ie201/barcodescanner2/FlashLightUtilForL.java b/app/src/main/java/team3/kau/ie201/barcodescanner2/FlashLightUtilForL.java
deleted file mode 100644
index 8a2faa6..0000000
--- a/app/src/main/java/team3/kau/ie201/barcodescanner2/FlashLightUtilForL.java
+++ /dev/null
@@ -1,141 +0,0 @@
-package team3.kau.ie201.barcodescanner2;
-
-import android.annotation.TargetApi;
-import android.graphics.SurfaceTexture;
-import android.hardware.camera2.*;
-
-import android.content.Context;
-import android.util.Size;
-import android.view.Surface;
-import android.widget.Toast;
-import java.util.*;
-
-@TargetApi(23)
-public class FlashLightUtilForL {
- private CameraCaptureSession mSession;
- private CaptureRequest.Builder mBuilder;
- private CameraDevice mCameraDevice;
- private CameraManager mCameraManager;
-
- public FlashLightUtilForL(Context context) {
- try {
- mCameraManager = (CameraManager) context.getSystemService(Context.CAMERA_SERVICE);
- //here to judge if flash is available
- CameraCharacteristics cameraCharacteristics = mCameraManager.getCameraCharacteristics("0");
- boolean flashAvailable = cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
- if (flashAvailable) {
- try {mCameraManager.openCamera("0", new MyCameraDeviceStateCallback(), null);}
- catch (SecurityException e){e.printStackTrace();}
-
-
-
- } else {
- //todo: throw Exception
- }
- //mCameraManager.openCamera("0", new MyCameraDeviceStateCallback(), null);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- class MyCameraDeviceStateCallback extends CameraDevice.StateCallback {
-
- @Override
- public void onOpened(CameraDevice camera) {
- mCameraDevice = camera;
- //get builder
- try {
- mBuilder = camera.createCaptureRequest(CameraDevice.TEMPLATE_MANUAL);
- //flash on, default is on
- mBuilder.set(CaptureRequest.CONTROL_AE_MODE, CameraMetadata.CONTROL_AF_MODE_AUTO);
- mBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_TORCH);
- List list = new ArrayList();
- SurfaceTexture mSurfaceTexture = new SurfaceTexture(1);
- Size size = getSmallestSize(mCameraDevice.getId());
- mSurfaceTexture.setDefaultBufferSize(size.getWidth(), size.getHeight());
- Surface mSurface = new Surface(mSurfaceTexture);
- list.add(mSurface);
- mBuilder.addTarget(mSurface);
- camera.createCaptureSession(list, new MyCameraCaptureSessionStateCallback(), null);
- } catch (CameraAccessException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void onDisconnected(CameraDevice camera) {
-
- }
-
- @Override
- public void onError(CameraDevice camera, int error) {
-
- }
- }
-
- private Size getSmallestSize(String cameraId) throws CameraAccessException {
- Size[] outputSizes = mCameraManager.getCameraCharacteristics(cameraId)
- .get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
- .getOutputSizes(SurfaceTexture.class);
- if (outputSizes == null || outputSizes.length == 0) {
- throw new IllegalStateException(
- "Camera " + cameraId + "doesn't support any outputSize.");
- }
- Size chosen = outputSizes[0];
- for (Size s : outputSizes) {
- if (chosen.getWidth() >= s.getWidth() && chosen.getHeight() >= s.getHeight()) {
- chosen = s;
- }
- }
- return chosen;
- }
-
- /**
- * session callback
- */
- class MyCameraCaptureSessionStateCallback extends CameraCaptureSession.StateCallback {
-
- @Override
- public void onConfigured(CameraCaptureSession session) {
- mSession = session;
- try {
- mSession.setRepeatingRequest(mBuilder.build(), null, null);
- } catch (CameraAccessException e) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void onConfigureFailed(CameraCaptureSession session) {
-
- }
- }
-
- public void turnOnFlashLight() {
- try {
- mBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_TORCH);
- mSession.setRepeatingRequest(mBuilder.build(), null, null);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- public void turnOffFlashLight() {
- try {
- mBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_OFF);
- mSession.setRepeatingRequest(mBuilder.build(), null, null);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- private void close() {
- if (mCameraDevice == null || mSession == null) {
- return;
- }
- mSession.close();
- mCameraDevice.close();
- mCameraDevice = null;
- mSession = null;
- }
-}
diff --git a/app/src/main/java/team3/kau/ie201/barcodescanner2/GMailSender.java b/app/src/main/java/team3/kau/ie201/barcodescanner2/GMailSender.java
deleted file mode 100644
index e8d7ee7..0000000
--- a/app/src/main/java/team3/kau/ie201/barcodescanner2/GMailSender.java
+++ /dev/null
@@ -1,108 +0,0 @@
-//stackoverflow.com/questions/2020088/sending-email-in-android-using-javamail-api-without-using-the-default-built-in-a
-
-package team3.kau.ie201.barcodescanner2;
-
-import java.io.IOException;
-import javax.activation.DataHandler;
-import javax.activation.DataSource;
-import javax.mail.Message;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeMessage;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.security.Security;
-import java.util.Properties;
-
-
-public class GMailSender extends javax.mail.Authenticator {
- private String mailhost = "smtp.gmail.com";
- private String user;
- private String password;
- private Session session;
-
- static {
- //Security.addProvider(new com.provider.JSSEProvider());//////////////////////////////////////////////////////////////////////////
- }
-
- public GMailSender(String user, String password) {
- this.user = user;
- this.password = password;
-
- Properties props = new Properties();
- props.setProperty("mail.transport.protocol", "smtp");
- props.setProperty("mail.host", mailhost);
- props.put("mail.smtp.auth", "true");
- props.put("mail.smtp.port", "465");
- props.put("mail.smtp.socketFactory.port", "465");
- props.put("mail.smtp.socketFactory.class",
- "javax.net.ssl.SSLSocketFactory");
- props.put("mail.smtp.socketFactory.fallback", "false");
- props.setProperty("mail.smtp.quitwait", "false");
-
- session = Session.getDefaultInstance(props, this);
- }
-
- protected PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(user, password);
- }
-
- public synchronized void sendMail(String subject, String body, String sender, String recipients) throws Exception {
- try{
- MimeMessage message = new MimeMessage(session);
- DataHandler handler = new DataHandler(new ByteArrayDataSource(body.getBytes(), "text/plain"));
- message.setSender(new InternetAddress(sender));
- message.setSubject(subject);
- message.setDataHandler(handler);
- if (recipients.indexOf(',') > 0)
- message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients));
- else
- message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients));
- Transport.send(message);
- }catch(Exception e){
-
- }
- }
-
- public class ByteArrayDataSource implements DataSource {
- private byte[] data;
- private String type;
-
- public ByteArrayDataSource(byte[] data, String type) {
- super();
- this.data = data;
- this.type = type;
- }
-
- public ByteArrayDataSource(byte[] data) {
- super();
- this.data = data;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getContentType() {
- if (type == null)
- return "application/octet-stream";
- else
- return type;
- }
-
- public InputStream getInputStream() throws IOException {
- return new ByteArrayInputStream(data);
- }
-
- public String getName() {
- return "ByteArrayDataSource";
- }
-
- public OutputStream getOutputStream() throws IOException {
- throw new IOException("Not Supported");
- }
- }
-}
diff --git a/app/src/main/java/team3/kau/ie201/barcodescanner2/JSSEProvider.java b/app/src/main/java/team3/kau/ie201/barcodescanner2/JSSEProvider.java
deleted file mode 100644
index a0f2089..0000000
--- a/app/src/main/java/team3/kau/ie201/barcodescanner2/JSSEProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @author Alexander Y. Kleymenov
- * @version $Revision$
- */
-package team3.kau.ie201.barcodescanner2;
-
-import java.security.AccessController;
-import java.security.Provider;
-
-public class JSSEProvider extends Provider {
-
- public JSSEProvider() {
- super("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
- AccessController.doPrivileged(new java.security.PrivilegedAction() {
- public Void run() {
- put("SSLContext.TLS",
- "org.apache.harmony.xnet.provider.jsse.SSLContextImpl");
- put("Alg.Alias.SSLContext.TLSv1", "TLS");
- put("KeyManagerFactory.X509",
- "org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl");
- put("TrustManagerFactory.X509",
- "org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl");
- return null;
- }
- });
- }
-}
-
-
diff --git a/app/src/main/java/team3/kau/ie201/barcodescanner2/infoActivity.java b/app/src/main/java/team3/kau/ie201/barcodescanner2/infoActivity.java
new file mode 100644
index 0000000..8927af4
--- /dev/null
+++ b/app/src/main/java/team3/kau/ie201/barcodescanner2/infoActivity.java
@@ -0,0 +1,13 @@
+package team3.kau.ie201.barcodescanner2;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+
+public class infoActivity extends AppCompatActivity {
+ //TODO: make it work with button
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_info);
+ }
+}
diff --git a/app/src/main/res/layout/activity_info.xml b/app/src/main/res/layout/activity_info.xml
new file mode 100644
index 0000000..edfe8e0
--- /dev/null
+++ b/app/src/main/res/layout/activity_info.xml
@@ -0,0 +1,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
index abb32a7..3c7ca19 100644
--- a/app/src/main/res/layout/content_main.xml
+++ b/app/src/main/res/layout/content_main.xml
@@ -41,4 +41,24 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c50d41c..a87007e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -3,6 +3,7 @@
Settings
Scan
KAU.IE201.TEAM3
+ 0.2