In this webpage you can have information about the development of various Android Applications
This webpage provides a comprehensive collection of tutorials on Android application development. The tutorials cover a wide range of topics including creating Android applications, handling technical aspects such as enabling unknown apps and accessing HDMI passthrough, integrating OAuth2 authentication, reading SIM card numbers, and accessing Gmail inbox programmatically. Additionally, there are tutorials on converting images into Base64 byte arrays, interacting with Firebase databases, and installing multiple launcher activities. The content also encompasses articles on PDF file creation, SMS programming, location tracking, and much more.
The provided links include tutorials on various topics, such as creating Android applications, integrating OAuth2 authentication, accessing Gmail inbox programmatically, working with Firebase databases, implementing radio buttons in a radio group, creating apps for augmented reality and AI chatbots, recording and splitting videos, dealing with HDMI input, and connecting to MS SQL Server databases from Android apps. There are also tutorials on topics like creating a voice-controlled image recognition app, building custom browsers, implementing Bluetooth features, accessing device information, and developing custom utility apps. Additionally, there are tutorials on creating apps for tasks like file management, integrating with external services like YouTube and SMS, implementing encryption, and working with sensors.
Furthermore, the content includes tutorials on creating diverse utility apps, including alarm clocks, audio recorders, PDF creators, step counters, and location trackers. There are also tutorials on topics like creating a simple business app, implementing fingerprint biometric authentication, and designing custom camera apps. Additionally, there are tutorials on implementing features such as phone call tracking, text-to-speech conversion, and QR code/barcode generation and scanning. The content also covers app development topics such as implementing file management, battery level access, and network type detection.
Below is the subpage of this collection:
For recent Pages, please refer below:
I read the report and it is very informative.
Thank you.
Cheers
Programmer World
–
Dear Sir,
How can I design a combobox with list of items in the store in the program of business app? On selection from the dropdown list, its detail (balance quantity, price etc.) should appear in the textbox. Is it possible?
Thanks a lot Sir.
Fysal Usman
I think you can design a listview as shown in the below video to display the data from the db:
https://programmerworld.co/android/how-to-develop-an-android-app-for-your-retail-business-b2c-using-firebase-database-source-code/
To choose what to display (like balance quantity, price, etc.), you can implement a drop-down or radio buttons or check-box option. Based on the selection, the output of the listview can be shown.
An example from the above link’s code is:
myRef.addValueEventListener(new ValueEventListener() {){(MainActivity.this, android.R.layout.simple_list_item_1, List));
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
ValueDatabase = dataSnapshot.getValue().toString();
refinedData = ValueDatabase.substring(1,ValueDatabase.length()-1);
String List[] = refinedData.split(“,”);
if(
listView.setAdapter(new ArrayAdapter
}
}
Hope above helps.
Good Luck
Programmer World
–
Thank you very much Sir. As always you are very quick to respond and help, which I value above all. I will, God willing, try as per your guidelines. If I stumble at any obstacle, let me contact you for your usual help and support.
Thanking you once again, I remain,
Very truly yours,
Fysal Usman
Sir, One more thing. Your program uses firebase database. I am using MS Sql database. How can I change the codes changing from firebase database to MS Sql?
Fysal Usman
For changing the code from Firebase to SQL, instead of ‘dataSnapshot’ in the below (Firebase code):
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {(MainActivity.this, android.R.layout.simple_list_item_1, List));
ValueDatabase = dataSnapshot.getValue().toString();
refinedData = ValueDatabase.substring(1,ValueDatabase.length()-1);
String List[] = refinedData.split(“,”);
listView.setAdapter(new ArrayAdapter
}
Use ‘Cursor’ as shown in the below SQLite database code:
Cursor myCursor = myDB.rawQuery(query, null);
if (myCursor.moveToFirst()){
myCursor.moveToFirst();
textViewDisplay.setText(myCursor.getString(0) + ” — ” + myCursor.getString(1));
}
You can refer to the below page in which it uses Sqlite database. Sqlite and MS Sql db concept will be similar.
https://programmerworld.co/android/create-a-simple-business-app-using-sql-lite-database-in-android-studio-for-beginners/
Good Luck
Programmer World
–
Thank you very much Sir. God willing, I will try.
Dear Sir,
After watching your both videos, which have pushed the frontier of my knowledge (at first it was zero) very far, I feel I need some more to meet my requirement. What I need is, instead of typing what I want to search, I should be able to pick from a dropdown list. This is because, the list of commodities are too many, and their names are not familiar, therefore, typing may result it spell mistake aborting my search. Can spinner (the android term for combobox) meet my requirement? If so, can you help me to code for that? I would ever remain grateful to you for that.
Thanks a lot Sir.
Fysal Usman
Yes, spinner will do the job.
Below is a sample example of spinner I implemented:
XML file (for layout design):
And then in the Java code:
private Spinner spinner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
spinner = findViewById(R.id.spinner);
spinner.setOnItemSelectedListener(this);
}
@Override
public void onItemSelected(AdapterView> parent, View view, int position, long id) {
switch (position) {
case 0:
// TODO … action
break;
case 1:
// TODO … action
break;
case 2:
// TODO … action
break;
}
}
@Override
public void onNothingSelected(AdapterView> parent) {
}
In the onItemSelected method, either you can use position or id in the switch case.
The layout should appear with below options in spinner:
Home
Work
Other
Custom
Cheers
Programmer World
–
Dear Sir,
I created spinner with your help, but when I ran it, message in the emulator saying the app has stopped. I am copy pasting the codes hereunder. If you can advise me where I have erred, that would be the greatest help I get from anybody.
MainActivity.java
package com.example.mobledger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.StrictMode;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.widget.Toast;
import com.example.mobledger.R;
public class MainActivity extends AppCompatActivity {
Spinner spinneritems;
String ip, db, un, passwords;
Connection connect;
PreparedStatement stmt;
ResultSet rs;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ip = “192.168.18.18”;
un = “sa”;
passwords = “12345678”;
db = “SelectionShoes”;
//server = “DESKTOP-63BPLJG”;
spinneritems = (Spinner) findViewById(R.id.spinneritems);
connect = CONN(un, passwords, db, ip);
String query = “select Name from Folio”;
try {
connect = CONN(un, passwords, db, ip);
stmt = connect.prepareStatement(query);
rs = stmt.executeQuery();
ArrayList data = new ArrayList();
while (rs.next()) {
String id = rs.getString(“Name”);
data.add(id);
}
String[] array = data.toArray(new String[0]);
ArrayAdapter NoCoreAdapter = new ArrayAdapter(this,
android.R.layout.list_content, data);
spinneritems.setAdapter(NoCoreAdapter);
} catch (SQLException e) {
e.printStackTrace();
}
spinneritems.setOnItemSelectedListener(new OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView parent, View view,
int position, long id) {
String name = spinneritems.getSelectedItem().toString();
Toast.makeText(MainActivity.this, name, Toast.LENGTH_SHORT)
.show();
}
@Override
public void onNothingSelected(AdapterView parent) {
}
});
}
@SuppressLint(“NewApi”)
private Connection CONN(String _user, String _pass, String _DB,
String _server) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
.permitAll().build();
StrictMode.setThreadPolicy(policy);
Connection conn = null;
String ConnURL = null;
try {
Class.forName(“net.sourceforge.jtds.jdbc.Driver”);
ConnURL = “jdbc:jtds:sqlserver://” + _server + “;”
+ “databaseName=” + _DB + “;user=” + _user + “;password=”
+ _pass + “;”;
conn = DriverManager.getConnection(ConnURL);
} catch (SQLException se) {
Log.e(“ERRO”, se.getMessage());
} catch (ClassNotFoundException e) {
Log.e(“ERRO”, e.getMessage());
} catch (Exception e) {
Log.e(“ERRO”, e.getMessage());
}
return conn;
}
}
Activity_main.xml
AndroidManifest.xml
Thanks a lot Sir.
Fysal Usman
Dear Sir,
It seems I missed to copy-paste Activity_main.xml and AndroidManifest.xml. I am giving them hereunder
AndroidManifest.xml
Activity_main.xml
I tried twice, but these xml files seem not being posted. If you give me your email, I can send them attaching as a text file or word file.
Thanks a lot Sir.
Dear Sir,
When I checked the logcat, I found this line which appears to be forcing to stop the app:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mobledger/com.example.mobledger.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
How to resolve this problem
Thanks a lot Sir
Fysal Usman
Dear Sir,
The abovementioned problem is solved as I changed ‘public class MainActivity extends AppCompatActivity’ to ‘public class MainActivity extends Activity’. After that, a new exception is thrown. In the logcat it says, ‘Caused by: java.lang.NullPointerException: Attempt to invoke interface method ‘java.sql.PreparedStatement java.sql.Connection.prepareStatement(java.lang.String)’ on a null object reference’. The referred sql statement is this:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ip = “192.168.18.18”;
un = “sa”;
passwords = “12345678”;
db = “SelectionShoes”;
//server = “DESKTOP-63BPLJG”;
spinneritems = (Spinner) findViewById(R.id.spinneritems);
connect = CONN(un, passwords, db, ip);
String query = “select Name from Folio”;
try {
connect = CONN(un, passwords, db, ip);
stmt = connect.prepareStatement(query);
rs = stmt.executeQuery();
ArrayList data = new ArrayList();
while (rs.next()) {
String id = rs.getString(“Name”);
data.add(id);
}
String[] array = data.toArray(new String[0]);
ArrayAdapter NoCoreAdapter = new ArrayAdapter(this,
android.R.layout.list_content, data);
spinneritems.setAdapter(NoCoreAdapter);
} catch (SQLException e) {
e.printStackTrace();
I should feel obliged and remain ever grateful to you for helping to solve this problem.
Fysal Usman
I think instead of prepareStatement, you can first try to createStatement on successful “connection” object. That will avoid null pointer exception on the “stmt” object. The same is shown in the below code:
https://programmerworld.co/android/how-to-connect-to-ms-sql-server-database-from-your-android-app-complete-steps/
Cheers
Programmer World
–