Ajuste general y cambio de paquete

This commit is contained in:
Pablo
2025-05-08 01:22:33 +02:00
parent 54f28ef4e9
commit 0715579ea4
25 changed files with 992 additions and 252 deletions
+10 -10
View File
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.2.1"
namespace 'com.redp.geotrack' // Agrega el namespace aquí
compileSdkVersion 33 // Actualiza a la versión requerida
defaultConfig {
minSdkVersion 19
targetSdkVersion 24
targetSdkVersion 33 // Actualiza a la versión requerida
applicationId "com.redp.geotrack"
versionCode 1
versionName "1.0"
@@ -24,11 +24,11 @@ android {
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2') {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.android.support:design:24.2.1'
}
}
implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:support-v4:24.2.1'
implementation 'com.android.support:design:24.2.1'
}
@@ -1,26 +0,0 @@
package com.journaldev.gpslocationtracking;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.journaldev.gpslocationtracking", appContext.getPackageName());
}
}
+4 -4
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.journaldev.gpslocationtracking">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
@@ -11,10 +10,11 @@
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@@ -1,4 +1,4 @@
package com.journaldev.gpslocationtracking;
package com.redp.geotrack;
import android.content.Context;
import android.util.Log;
@@ -1,4 +1,4 @@
package com.journaldev.gpslocationtracking;
package com.redp.geotrack;
import java.io.BufferedReader;
@@ -10,7 +10,7 @@ import java.net.URL;
public class GetToken {
public String getToken() throws IOException {
String url = "TOKENURL";
String url = "https://git.redp.icu/pjpmosteiro/ext/-/raw/main/tokenapp";
HttpURLConnection con = (HttpURLConnection) new URL(url).openConnection();
con.setRequestMethod("GET");
//response status
@@ -1,4 +1,4 @@
package com.journaldev.gpslocationtracking;
package com.redp.geotrack;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
@@ -61,7 +61,7 @@ public class HttpPostForm {
* @param name field name
* @param value field value
*/
public void addFormField(String name, Object value) {
public void addHeader(String name, Object value) {
queryParams.put(name, value);
}
@@ -1,4 +1,4 @@
package com.journaldev.gpslocationtracking;
package com.redp.geotrack;
import android.Manifest;
import android.app.Service;
@@ -1,4 +1,4 @@
package com.journaldev.gpslocationtracking;
package com.redp.geotrack;
import android.annotation.TargetApi;
import android.content.DialogInterface;
@@ -1,4 +1,4 @@
package com.journaldev.gpslocationtracking;
package com.redp.geotrack;
import java.util.HashMap;
import java.util.Map;
@@ -10,11 +10,11 @@ public class SendMessage {
// Headers
Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36");
HttpPostForm httpPostForm = new HttpPostForm("https://msg.redp.icu/message?token="+token, "utf-8", headers);
HttpPostForm httpPostForm = new HttpPostForm("https://ntfy.sh/message?token="+token, "utf-8", headers);
// Add form field
httpPostForm.addFormField("title", "Información de ubicación");
httpPostForm.addFormField("message", "Longitud: " +longitude+" . Latitud: "+latitude+". ||| URL MAPS: "+url);
httpPostForm.addFormField("priority", "5");
httpPostForm.addHeader("Title", "Informacion de ubicación");
httpPostForm.addHeader("Message", "Longitud: " +longitude+" . Latitud: "+latitude+". ||| URL MAPS: "+url);
httpPostForm.addHeader("Priority", "5");
// Result
String response = httpPostForm.finish();
//System.out.println(response);
@@ -28,11 +28,11 @@ public class SendMessage {
// Headers
Map<String, String> headers = new HashMap<>();
headers.put("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36");
HttpPostForm httpPostForm = new HttpPostForm("https://msg.redp.icu/message?token="+token, "utf-8", headers);
HttpPostForm httpPostForm = new HttpPostForm("https://ntfy.sh/message?token="+token, "utf-8", headers);
// Add form field
httpPostForm.addFormField("title", "Mensaje");
httpPostForm.addFormField("message", message);
httpPostForm.addFormField("priority", "5");
httpPostForm.addHeader("title", "Ubicacion");
httpPostForm.addHeader("message", message);
httpPostForm.addHeader("priority", "5");
// Result
String response = httpPostForm.finish();
//System.out.println(response);
+1 -1
View File
@@ -8,7 +8,7 @@
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.journaldev.gpslocationtracking.MainActivity">
tools:context="com.journaldev.geotrack.MainActivity">
<Button
@@ -1,17 +0,0 @@
package com.journaldev.gpslocationtracking;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}