|
I am using windows 10. Android studio Koala latest release. Have used Hedgehog and Chipmunk versions. The Chipmunk version gave google maps and settings activity template. For Hedgehog these activity templates disappeared after 3 projects. Now when I have installed Koala it shows only 5 templates. I need the settings template but can't find it in koala and Hedgehog. Is it just me or everyone having this problem. And it its only at my end how do I get the template setting activity. Got stuck in my first new project
I have tried uninstalling and reinstalling the Koala and Hedgehog versions but no change. Problem persists
|
|
|
|
|
Hi Preeti,
Can you try these solutions
Update Android Studio: Ensure you have the latest version installed.
Check Plugins: Go to File > Settings > Plugins and ensure relevant plugins are enabled.
Reset IDE Settings: Go to File > Manage IDE Settings > Restore Default Settings to reset Android Studio.
Manually Create a Settings Screen:
Create a new empty activity: File > New > Activity > Empty Activity and name it SettingsActivity.
Add a PreferenceFragmentCompat to manage your settings:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<EditTextPreference
android:key="example_key"
android:title="Example"
android:summary="An example preference"/>
</PreferenceScreen>
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportFragmentManager().beginTransaction()
.replace(android.R.id.content, new SettingsFragment())
.commit();
}
public static class SettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.preferences, rootKey);
}
}
}
I hope this will work for you and resolve your issue....... .
|
|
|
|
|
I want to build my Android Studio project from command line as opening it consumes too much RAM. Besides, my app is "WebView heavy", most of the work happens in HTML/JS/CSS inside of the webview, so it makes sense to build the APK/AAB directly from command line for testing. So far, I'm able to generate bunlde with the below command after setting the JAVA_HOME to \path\to\android-studio\jre\jre
gradlew bundle
However, this generates only the bundle file (*.aab) and that too the unsigned or debug version. What I want to generate is:
- Signed *.aab to release on Play Store.
- Unsigned *.apk for testing.
When I list the tasks using gradlew tasks command, it gives me the below. What should I do to achieve these objectives? I already tried some other tasks (build and assemble) as parameters but they result in error.
EDIT: OK, found some helpful information here. The second one (debug APK) I managed with the assembleDebug task. The first one (signing the aab) is still a constraint.
> Task :tasks
<hr />
<h2>Tasks runnable from root project</h2>
<h2>Android tasks</h2>
androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for the base and test modules
sourceSets - Prints out all the source sets defined in this project.
<h2>Build tasks</h2>
assemble - Assemble main outputs for all the variants.
assembleAndroidTest - Assembles all the Test applications.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
bundle - Assemble bundles for all the variants.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
<h2>Build Setup tasks</h2>
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.
<h2>Cleanup tasks</h2>
lintFix - Runs lint on all variants and applies any safe suggestions to the source code.
<h2>Help tasks</h2>
buildEnvironment - Displays all buildscript dependencies declared in root project 'Python MCQ'.
components - Displays the components produced by root project 'Python MCQ'. [incubating]
dependencies - Displays all dependencies declared in root project 'Python MCQ'.
dependencyInsight - Displays the insight into a specific dependency in root project 'Python MCQ'.
dependentComponents - Displays the dependent components of components in root project 'Python MCQ'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'Python MCQ'. [incubating]
projects - Displays the sub-projects of root project 'Python MCQ'.
properties - Displays the properties of root project 'Python MCQ'.
tasks - Displays the tasks runnable from root project 'Python MCQ' (some of the displayed tasks may belong to subprojects).
<h2>Install tasks</h2>
installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.
<h2>Verification tasks</h2>
check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintVitalRelease - Runs lint on just the fatal issues in the release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL in 4s
1 actionable task: 1 executed
modified 14-Jun-24 12:44pm.
|
|
|
|
|
In Android Studio, I came across different ways to implement onCreateOptionsMenu() and onPrepareOptionsMenu() each with respect to the return statement in an Activity that extends from AppCompatActivity . It is quite confusing to me as to which one is the right way to implement the two methods, given that I want to maintain equality of syntax all across my application.
onCreateOptionsMenu()
Example 1: Only true is returned.
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.game_menu, menu);
return true;
}
Example 2: Call to super class is returned.
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.options_menu_activity_dashboard, menu);
return super.onCreateOptionsMenu(menu);
}
Example 3: Call to super class is done in the first line and true is returned later.
public boolean onCreateOptionsMenu(Menu menu){
super.onCreateOptionsMenu(menu);
Intent intent = new Intent(null, dataUri);
intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
menu.addIntentOptions(
R.id.intent_group,
0,
0,
this.getComponentName(),
null,
intent,
0,
null);
return true;
}
As you see, in the third example, call to super class is done followed by returning true . But in the first two examples, either true or call to super class is returned. Which one is the right way to do it?
onPrepareOptionsMenu()
Example 1: Call to super class is returned.
public boolean onPrepareOptionsMenu(Menu menu) {
if (Build.VERSION.SDK_INT > 11) {
invalidateOptionsMenu();
menu.findItem(R.id.option2).setVisible(false);
menu.findItem(R.id.option4).setVisible(true);
}
return super.onPrepareOptionsMenu(menu);
}
Example 2: Call to super class is done in the first line and true is returned later.
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.findItem(R.id.action_save).setVisible(true);
menu.findItem(R.id.action_reset).setVisible(true);
menu.findItem(R.id.action_about).setVisible(true);
return true;
}
Here too the same question arises. Which syntax should I follow to implement the method properly?
|
|
|
|
|
Why not call the super class method first, and if it returns false , bail early?
Eg:
public boolean onPrepareOptionsMenu(Menu menu) {
if (!super.onPrepareOptionsMenu(menu))
{
return false;
}
menu.findItem(R.id.action_save).setVisible(true);
menu.findItem(R.id.action_reset).setVisible(true);
menu.findItem(R.id.action_about).setVisible(true);
return true;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for your suggestion. I'll keep that approach in mind for future reference. However, I found a better way to deal with the situation. Unless my code relies on a superclass's implementation, returning true after my modifications is straightforward. If I ever extend a class and want to allow the superclass's logic to still apply, I'll use the super call then. That seems to be the optimal approach.
|
|
|
|
|
I want to ask a question to put the homepage design of browser in android , i want to put top toolbar ,middle widget and bottoms toolbar. Top toolbar need my icon 1.Tabs with horizontal layout when user clicks in tabs the horizontal layout must be displays horizontal. 2. Home button 3. URL bar with lock icon and refresh navigation tools 4.Security icon 5. more settings that contains 3 dot. middle widget contains that i have plan to put Time with days, Date, Weather, google search, (social media, google.com, Youtube combine gallery of bookmark with photo), News. Bottoms Toolbar must contains back and forward navigation button , Add new tab , Extension, tabs collection button. I want to put some screenshots for it.[[[enter image description here](https:
note. send message personally.. bibekpoudel255@gmail.com
i want to get suggestion and and some code to design. i already ask ChatGpt but horizontal layout cannot solve that i send in photo. i want to design tab layout same as photo . I want to know how can i make it same....
|
|
|
|
|
Nobody is going to send you a personal email on this. The conversation either happens in the forum or it doesn't happen at all.
Oh, and posting your email address in a public forum only invites spammers to flood your inbox.
modified 7-Feb-24 9:45am.
|
|
|
|
|
He uses ChatGPT. A flooded inbox is the least of his worries.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Everything is good, but when I enter the data, it says the "Sign Up successfully" but when I check there's no update on the Firebase Realtime Database. There are Android Manifest.xml and SignUp.java code.
Can anyone help me ?
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
="" xmlns:tools="http://schemas.android.com/tools" package="com.example.projectfyp">
<uses-permission android:name="android.permission.INTERNET">
<application
android:allowbackup="true"
="" android:dataextractionrules="@xml/data_extraction_rules" android:fullbackupcontent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="QuizzyWonders" android:roundicon="@mipmap/ic_launcher_round" android:supportsrtl="true" android:theme="@style/Theme.ProjectFYP" tools:targetapi="31">
<activity
android:label="QuizzyWonders"
="" android:name=".Login" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN">
<category android:name="android.intent.category.LAUNCHER">
<activity
android:label="QuizzyWonders"
="" android:name=".SignUp" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN">
<category android:name="android.intent.category.LAUNCHER">
<activity
android:label="QuizzyWonders"
="" android:name=".content1">
SignUp.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sign_up);
//get data from edit text
email_user = findViewById(R.id.email_user);
etUName = findViewById(R.id.etUName);
etPass = findViewById(R.id.etPass);
confirm_password = findViewById(R.id.confirm_password);
btnSignUp = findViewById(R.id.btnSignUp);
btnSignUp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//get data to string
final String email = email_user.getText().toString();
final String username = etUName.getText().toString();
final String password = etPass.getText().toString();
final String confPassword = confirm_password.getText().toString();
//ensure user fill in all the required fields
if(TextUtils.isEmpty(email)){
email_user.setError("Email cannot be empty!");
email_user.requestFocus();
}else if(TextUtils.isEmpty(username)){
etUName.setError("Username cannot be empty!");
etUName.requestFocus();
}else if(TextUtils.isEmpty(password)){
etPass.setError("Password cannot be empty!");
etPass.requestFocus();
}else if(TextUtils.isEmpty(confPassword)){
confirm_password.setError("Please enter your confirmation password!");
confirm_password.requestFocus();
} else if (!password.equals(confPassword)) {
Toast.makeText(getApplicationContext(), "The passwords are not match!", Toast.LENGTH_SHORT).show();
}else {
databaseReference.child("Users").addListenerForSingleValueEvent(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot snapshot) {
//check if username is not registered before
if(snapshot.hasChild(username)){
Toast.makeText(getApplicationContext(), "Username is already registered!", Toast.LENGTH_SHORT).show();
}else {
//username as unique identity of every user
databaseReference.child("Users").child("UserName").setValue(username);
databaseReference.child("Users").child("UserPassword").setValue(password);
Toast.makeText(getApplicationContext(), "User sign up succesfully!", Toast.LENGTH_SHORT).show();
finish();
}
}
@Override
public void onCancelled(@NonNull DatabaseError error) {
Toast.makeText(getApplicationContext(), ""+error.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
});
}
|
|
|
|
|
Hi guys, i want to know, can you guys tell me what I need to learn to create a simple web application for ecommerce website (not a complicated marketplace app) like for example: "shoes website" with the abilities for customers to sign up and put the product into shopping cart and then check out with simple payment system like paypal?
|
|
|
|
|
I am not sure why you posted this in the Android forum.
However, you need to study ASP.NET or PHP for the backend, HTML, CSS and Javascript for the frontend, and a suitable Database system. You can also Google for ecommerce to see if there are templated systems available to get you started.
|
|
|
|
|
can this ecommerce website be transformed into or opened as android app as well?
|
|
|
|
|
Possibly, but this is not something you can achieve in an afternoon. The question again requires considerable research.
|
|
|
|
|
Anyway, last question. What is the suitable database system for this ecommerce website that can store customers accounts and then send their order to us as well as payment confirmation when they have made the payment?
Thanks for your answers. really helped a lot with your answers. I have learned HTML, css and currently working on JavaScript. Anyway, do i need to learn about Typescript and React as well as Im building this web ecommerce website for android app as well?
|
|
|
|
|
The most common database systems are MySQL and Microsoft SQL Server. But you would need to study both to decide which is best for you. I do not know whether Typescript and React would be necessary or not, but their respective websites would probably give some ideas.
|
|
|
|
|
Ben A Johnson wrote: learn to create a simple web application
What you described is not simple.
Simple would be just to get a web server up and responding to a request.
Ben A Johnson wrote: what I need to learn
1. Do you know a normal programming language? Java, C# and/or C/C++. But JavaScript might also work (but NOT using it only in a web page.)
2. Database. Doesn't matter which one. You don't actually need to learn a relational one (SQL) but I consider those more useful, but more difficult, to learn.
3. Basics of Web Servers: Server, Client, other misc stuff, like how IP works.
4. After you learn most of that then you need to get a basic web server up which usually requires some sort of 'web server'. Which one depends on what you learned above.
5. Then you need to learn how to deliver content to a Client. So for example how a browser sends a request then gets a response.
After all of that then you could start, if that is your real goal (this forum) learning how to create a cell phone application. Such as one that runs on an Android phone. There are examples out there that would allow you to start from this step but it might not help if you do not understand at least some of the above.
|
|
|
|
|
Thank you so much for all of your answers man. Really helpful a lot. Yes, I'm still learning about JavaScript and I have been doing some research on YouTube regarding how to build an ecommerce website/app using MySQL PHP. But I want to ask. So i saw a video where this guy create an ecommerce site (clothing site) with the abilities for customers to sign up and then edit their profile (shippinng address, avatar, phone number, so on), and the admin is also able to edit any product that he sells through the admin page of his site. What i want to ask is, when he opens his admin page (where he can edit all of his products, verify payment, verify whether the product has been shipped or not, etc) is that ADMIN PAGE MySQL? How did he create that admin page? Did he build it from a scratch? I'm sorry for asking this, but I still want to get a better understanding about how this ecommerce site works?
|
|
|
|
|
There is nothing special about that page versus other pages. Any page does what the page does. Only difference there is that the page (and supporting backend functionality) was written to do that.
Basic outline of functionality for a page
browser => front end => business logic (of some sort) => database layer (of some sort) => database
Everything else is in the the details.
Since you mentioned PHP and MySQL you could look at LAMP. However I am not sure that is a good route for you to take at your experience level. But there might be some better tutorials now (versus very long ago when I looked to help.) If you go down that route then use Python rather than PHP since it is more widely used thus knowledge of it is more beneficial.
LAMP (software bundle) - Wikipedia[^]
|
|
|
|
|
Hi I was just seeing a video on YOuTube explaining about MySQL and how it works with localhost XAMPP especially to create the database of data like products, customers, etc. What I want to know, Can I just learn about MySQL, HTML, CSS and JavaScript to make a fully working ecommerce website? And if I want to make an Android app of that ecommerce website, what else do I need to learn? Do i need to learn about React, Python and Java too (with Android studio)?
|
|
|
|
|
Ben A Johnson wrote: Can I just learn about MySQL, HTML, CSS and JavaScript to make a fully working ecommerce website? Not quite, as you need backend code to act as the interface between the web pages and the database. So you will need C#/VB.NET or PHP for that part. As to the Android system, you need to study some articles on Android development.
|
|
|
|
|
Thanks for your reply. Yes, I just saw a video explaining about the connection between HTML page, PHP and MySQL database? And how the login password or how user can register an account and then connect their data using PHP to our MySQL database using XAMPP. I wanna ask again. About MySQL. After we finish creating our database from user information, our products, etc using MySQL, do we need to upload these database (including our website with HTML, css and JavaScript) from our localhost (XAMPP) to our web hosting/server so the who ecommerce site can start operating?
|
|
|
|
|
You can host your database anywhere you like, although the logical place is on the webserver. And you would use that live database for all your account creation, i.e. users register on the site and then use their id and password for future logins.
But, TBH, you seem to be trying to run before you can walk. You should start small and get a basic website working, with a simple front end page and a simple text file rather than a database at the back end. That would help you to understand some of the issues that need to be worked on. The internet, and indeed Web Development[^] here on CodeProject, has many articles and samples that will help you.
|
|
|
|
|
As said before and just with the last post...
You cannot understand the big picture until you have at least some familiarity with some of the various parts. You need to pick a part and start learning just that part.
|
|
|
|
|
I received the following message from you, but it does not appear in the forum here (maybe you deleted it):
Quote: Thanks man for your reply. Yes you are right. I think i need to build simple website project for ecommerce first before jumping to the more difficult parts. I wanna ask by the way, so i found these 2 cool websites: Netlify and then 000webhost. And these 2 sites offers free web hosting for web projects and also Database with phpmySQL, and you can add your own domain there. what do you think about these 2 sites, are they legit and can be trusted for our professional web projects like serious ecommerce sites.
I cannot say whether either of those site will help you as I have no experience of them. However, as I and @jschell keep saying, you need to start with something simple. Forget about ecommerce as you are nowhere near ready to implement such a system. Just create a simple website that allows you to enter some data that can be checked by the backend. If necessary the backend can write it to a file so you can do some manual checking. You could host such a system on your own PC using IIS, which is part of Windows. I have such a system on my PC and it works fine as a test bed.
|
|
|
|
|