different icon in android studio project - Kotlin activity - android-studio

I'm using Android studio Bumblebee 2021.1.1 and building an app.
In Android Studio, in the Project list of files, what is the difference between these 2 icons :
Both files above are activities files.
Thank you.

The first one is Kotlin Class - It contains only one class with the same class name i.e file name and the class name are the same
The second one is Kotlin File - Which contains multiple classes with different names

Related

Android Studio ActivityMain.kt not finding IDs of TextView, Buttons etc from activity-main.xml

I'm trying to learn programming. Using Android Studio I have created an
TextView and and Button in activity_main.xml and now I'm trining to use this two in MainActivity.kt but Android Studio cannot find the IDs of my Textview nor of my button. Am I doing something wrong?
Thanks for your help and suggestions.
OS ManjaroLinux
Android Studio v. 4.1.1 installed by Flatpack
using Kotlin as programming language
Images of my problem
Button declaration activity_main.xml
TextView declaration activity_main.xml
MainActivity.kt error
Refer ids of components using R.id.*.
For example, if the id is defined by :
android:id="#+id/buttonTxt"
Then refer it by :
val button = findViewById<Button>(R.id.buttonTxt)
The same applies for any resources like strings (R.string.*), colors, dimens etc.

how to create a class in android studio thats parallel table in backendless

how do i get a field type pointer from backendless table into a class (object) in android studio
Building building = (Building) Backendless.UserService.CurrentUser().getProperty("building");
Try using Backenldess Code Generation tool.
Steps:
Select "Code Generation" in console
Select IDE
Select "Java classes for defined data tables" checkbox
Download generated code
Open downloaded project in Android Studio
See screenshot below:

Cannot create class-file Android Studio

I'm trying to integrate Google Calendar API into my android project and I follow the tutorial here
https://developers.google.com/google-apps/calendar/quickstart/android
At step 5 create a new java class
I right click project folder src>main>java>com>example>utarapp and then new>file and entered the file name but then it has this error
What's going on ?
I'm using android studio 1.3.1
I think you are trying to create file with same name which is already present in the same package. This may be one possible reason.
It seems like you are right-clicking on the upper level in your application's directory tree.
Right click on one of the files inside the utarapp folder and then select Java class option from the menu.
For me this was happenning because of the length of the class name. In my case it was "ChallengesFragmentPagerAdapter"!
Changing it to "ChallengesPagerAdapter" solved the problem.
Create a blank Activity then remove "extends Activity" from the activity class.

How do I add a .java file using Android Studio?

(Noob alert!)
I want to add an SQLite component to a simple (one Java source file) app and would like to put it in a separate file. I was hoping to find something that would let me click a couple check boxes and creae the file using a template with the standard overrides and class declarations (e.g. ... MyClass extends SQLiteOpenHelper {...} and so on. Instead I can't even figure out how to add an empty .java file to the project. Google's Android Studio Tips 'n Tricks suggest navigating to the 'appropriate directory in the Project pane' and hit N. That gets me a dialogue that rejects my class name and seems to open a header file if I enter the name if the class I wish to extend (and without apparently adding anything to my project.)
I do not even see a way to add an existing file to the project. OK... I now see that if I create the .java file in the app directory (along side the MainActivity.java file) that Android Studio automatically includes it.
Is this Standard Operating Procedure? It leaves me feeling like I'm not leveraging the capabilities that Android Studio provides.
I'm using AS 0.5.2, openJDK 1.7.0
Thanks!`
If you're creating a new Java class from the Project pane, you don't need to add the ".java" to the name; you're specifying the name of the Java class, not the source file. It will figure out the filename automatically.

How do I add new class to my project in Visual C++ 6

I want to add a new class to my Visual C++ 6 project using Class Wizard. I don't want this class to inherit from anything. My class has a function to accept input as integer, and process it
The Class Wizard requires me to add a base class and a DialogID . Which one of the base classes and dialog ID shoud I select? I'm a C# developer and find it really annoying. Should I mannually add my class? How do i do it in Visual C++ 6
Don't use Class Wizard (which is for creating visual dialogs and is why it wants a dialog id).
Use Project->Add from the menu. There are several other types of things you can add to your project that don't involve visual dialogs, like header (.h) and source code (.cpp) files.

Resources