The data you could obtain are within a json object but the data you indicate are also within an object called "contact": Get the object "contact" and then its properties:JSONObject jsonObjectContact = jsonObject.getJSONObject("contact");
Toast.makeText(getApplicationContext(), "Respuesta"+
jsonObject.getString("id") + " " +
jsonObject.getString("name") + " " +
jsonObject.getString("email") + " " +
jsonObject.getString("gender") + " " +
jsonObjectContact.getString("mobile") + " " +
jsonObjectContact.getString("home") + " " +
jsonObjectContact.getString("office"), Toast.LENGTH_LONG).show();
SharedPreferences are used for permanent data storage. If you need the value only during the work of the annex, keep it in mind. For example, heir class Application:public class App extends Application {
public static App INSTANCE;
private int count = 1;
@Override
public void onCreate() {
super.onCreate();
INSTANCE = this;
}
public void setCount(int newCount) {
count = newCount;
}
public int getCount() {
return count;
}
}
Obtaining importance App.INSTANCE.getCount()♪ Set. App.INSTANCE.setCount(5)♪When the annex is closed, the value will be dropped and set at 1.And don't forget to write class. App Manifest:<application
android:name="com.example.App"
...
What's going on is that your fragment ProductosCategoriaFragment It's still not shown when you want to send the data. In the part where you do myfragment = (ProductosCategoriaFragment) getSupportFragmentManager(), you may or may not show the fragment (depending on the number of fragments you have on screen). If you're just showing a fragment at once, the getSupportFragmentManager().findFragmentById() He'll give you back a null. Finally, miFragmento It's him. fragment you want to show and add it with a transaction. That one. fragment is the one you have to use to receive your data.public void enviarDatos(Categoria categoria) {
miFragmento = new ProductosCategoriaFragment();
getSupportFragmentManager().beginTransaction().replace(R.id.contenedor,miFragmento).commit();
miFragmento.recibirDatos(categoria);
}
So you see you need to connect your MySQL database with Android. But unfortunately this is not possible. Android does not support MySQL as a database engine to install it. The only solution you have is to make a web service that you should consume in your Android app and from this web service consult your MySQL database.Another important point is that to make persistence (keep the values of your MySQL database in your Android app to handle, maintain, etc.) is that you do a SQLite database.I'll leave you a complete http://www.hermosaprogramacion.com/2014/10/android-sqlite-bases-de-datos/
1 fragment of the code is called exactly 1 times. It's in one second with help. handler.postDelayed(..., 1000) it works.2 fragments of the code are summed directly by method handler.post and at the end of its work handler.postDelayed(this, 1000); I mean, it's about 1 second.In general, I recommend that we look at the class. CountDownTimerwhich does the same thing in principle, but "from the box."
I do it through FileProvider, for this you must declare it in the manifest: <provider
android:name="androidx.core.content.FileProvider"
android:authorities="${filesAuthority}"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths_app" />
</provider>
Where the filestAuthority is a constant declared in the build gradle of the app module. I declare it here so that it can also be accessed from the code programmatically:defaultConfig {
def filesAuthorityValue = applicationId + ".fileProvider"
manifestPlaceholders = [filesAuthority: filesAuthorityValue]
buildConfigField("String", "FILES_AUTHORITY", "\"${filesAuthorityValue}\"")
}
And finally you need to create in res/ a xml package - parent res/xml and xml file, for example provider-paths.xml:<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
name="external"
path="." />
<external-files-path
name="external_files"
path="." />
<cache-path
name="cache"
path="." />
<external-cache-path
name="external_cache"
path="." />
<files-path
name="files"
path="." />
</paths>
After the configuration, the uri for the intent is:Uri uri = FileProvider.getUriForFile(yourContext, "com.your.project.root.fileProvider", yourPdfFile)
First try to see what's going on with the field down in the request. SELECT *, lower(name) AS LowerCase FROM articles
So you'll understand the problem with the code or not, if the register is lower, try to make a request differently, for example,SELECT *, lower(name) AS LowerCase FROM articles WHERE
LOCATE(lower('".$sear."'), LowerCase)
If it didn't work, then look towards the construction of the base code.
You can use the class. https://developer.android.com/reference/android/location/LocationManager.html to obtain latitude and longitude values:LocationManager locationManager = (LocationManager)
getSystemService(Context.LOCATION_SERVICE);
Criteria criteria = new Criteria();
Location location = locationManager.getLastKnownLocation(locationManager
.getBestProvider(criteria, false));
double latitude = location.getLatitude();
double longitud = location.getLongitude();
These values can be saved in preferences to be reused.Check this out. https://es.stackoverflow.com/a/8564/95 where methods are found to save and obtain preferences in your application
I've changed the values of the Excel file, but that has nothing to do with it. Having an Excel this way. We just have to go through the first column, we do this with a simple shekel. for that itere in the column A.from openpyxl import load_workbook
#cargamos el archivo
wb = load_workbook('ejemplo.xlsx')
sheet = wb['Sheet1'] #cargamos la hoja
#pedimos un dato al usuario
entrada = input("sitio a buscar: ")
for cell in sheet["A"]:
if cell.value == entrada:
print(cell.value, sheet[f"B{cell.row}"].value)
By having our already loaded sheet we can tell you a specific column to do any operation, by making a for He'll give us an object. Cell of which we can already extract its properties value. Within the cycle it is checked if the value of the cell is equal to the one introduced by the user, if that is the case the name of the site and the password is shown. As the password is in the back column (columna B) then we only access the property row of cell that returns us the row in which we are, so we use f-strings to match and extract its value.
Because else It's for a mistake. If there is no result but the consultation was done correctly then the function isSuccessful() returns real.Try for example by removing reading permissions and that will give you a mistake that will appear in the else.
It's Vuforia, it's better than OpenCV. But keep in mind that the world inside the camera is transforming and there are laws and mathematical models.
See, for example, Zissermann-Hartley http://cvrs.whu.edu.cn/downloads/ebooks/Multiple%20View%20Geometry%20in%20Computer%20Vision%20(Second%20Edition).pdf and if reading doesn't give a bad discomfort, you can try to program in a month.
Don't even take it without math. For the purpose of identifying Zissermann-Hartley objects, of course, it's a lot, but it's the basis in any case.
And directly the task will be useful, for example, https://www.intorobotics.com/how-to-detect-and-track-object-with-opencv/