"Layout" folder not appearing in "res" folder - android-studio

Recently I installed android studio and wanted to create a map, selected java language instead of kotlin.
As I was following a guide on internet,
https://developers.arcgis.com/android/latest/guide/install-and-set-up.htm
it said to select "Main_activity.xml" in res->layout.
But I couldn't find any layout folder.
Here's the image of my project view:Android Project View
Thank You

From your "Android Project View"
In Java folder, you can see three "com.ecample.hackathon" folders, among these three folders first one is blank, when we create any Activity in our project, java class show at here, and xml file show in layout folder(parent is res folder).
So now, you have to create Activity.
Steps:
1) Right click on this empty folder "com.ecample.hackathon"
2) Select New
3) Than Select Activity
4) As per your choice you can select the option.
Ex. Select "Empty Activity
Name as according your use.
You can get java and xml file in proper place.
Hope this help you.

Related

Create folder in Android View

I want create a folder for java source code that is visible in the "Android" view. This is not an asset or layout or res folder. Just a simple folder that becomes visible and accessible.
I know how to create a new folder but it's only visible in the "Project" view. I never see it in the "Android" view.
In java, folders are called packages. You can create a folder for your source code in the java folder by right clicking it and selecting new>Package.
It is important to note that classes in different packages can only access public members.

Asp.Net Core 2 after publishing get error "Layout cannot be found"

After publishing the application I get the error:
"InvalidOperationException: The layout view '_Layout' could not be located. The following locations were searched:
/Views/Home/_Layout.cshtml
/Views/Shared/_Layout.cshtml
Microsoft.AspNetCore.Mvc.Razor.RazorView.GetLayoutPage(ViewContext context, string executingFilePath, string layoutPath)"
The Layout is there in the Views/Shared folder and the application works with it locally, so this must be something wrong with the publishing.
Unfortunately in the published app the views appear all contained into a single dll file and I cannot do anything to solve the problem.
Could be anything in my code that makes the publisher to forget to add the _Layout.cshtml view?
I have a reference to the layout in my _ViewStart.cshtml
That should be for all pages. Without Layout my app is doomed and I do not know what to do.
Ok After many tries I found the cause of why the publishing did not include my layout page! It was so tricky that I am amazed. I hope this helps other people!
When you right-click on the layout file (or on any other file) you have the menu with the option properties. I opened the properties of the layout file and I noticed that there you have an "advanced" option: "Compilation Action". My option was set to "none" that means the file was not compiled and therefore not included in the publishing. I put it on "Content" and tried the publishing again and all went well, this time the layout file was compiled and included in the publishing.
In my case the "Copy to output directory" was set to "Do Not Copy", I changed it "Copy if newer" and then it work.

Can't create layout folder in Android Studio by new Android Resource Directory (Error : enter or select a qualifier)

Step 1 : Right click on res folder, choose New > Android Resource Directory
Step 2 : Choose layout in resource type, then click OK
Result : Error in name : enter or select a qualifier
It's not happen with menu type. Do I missing something?
I have to create directory instead
It's an old question but whoever is having the same problem might find this helpful. Here's another way to create an android resource directory in the layout folder.
Right click res folder
Click new and the scroll all the way down to XML with the icon
Click that and leave everything as it is
= Click finish.
Also, make sure to refactor and rename(whatever you like) the XML file that gets generated automatically after creating the resource folder.
Yeah, AS 3.0+ seems to do that to me as well.
But there really shouldn't be a difference between a new Android Resource Directory and just a new (regular) Directory if you don't actually use any qualifiers. It's still just a directory with a different name depending on the qualifier(s). So, you can safely choose new Directory and move along.
And for the sake of it, you can choose new Android Resource Directory with some random qualifier which will just add the qualifier to the directory name, and after it's created, refactor it by deleting the qualifier part from the directory name and you'll end up with a directory named "layout" which is an "Android Resource Directory".
Just do the refactoring with the Project view selected in the Project pane, not the Android view.

Intellij IDEA Hotswap for .xhtml files with WebLogic

I have been working to find out this problem however with no success. I have a project that uses primefaces and .xhtmls, .javas etc. I am using Weblogic server in Intellij IDEA. I am trying to see changes from my browser when I change the .xhtml file and use "update classes and resources". However, I am not successful for that. By the way, this works when I changed the .java file. For .xhtml file there is no success.
PS: I use exploded artifact for that.
PS2: When I use "Update classes and resources" button, I see that ear is updated from windows explorer.
PS3: I used On 'Update' action with 'Update classes and resources' option, I used On frame deactivation with 'Update classes and resources' option and with different options, but no, nothing, no success.
I have similar setup and this works for me:
Deploying an exploded artifact;
Exploded artifact should be build on make (Ctrl+F9) - go to File > Project Structure > Artifacts and check "Build on make";
Build/make with IDE compiler (e.g not with maven) in order the IDE to understand that there is a changed file and to replace it.
The above is enough to update the xhtmls on every build/make of the project (Ctrl+F9), I do not use "Update classes and resources" neither manually nor automatically (e.g on frame deactivation)
To update resources on your server you need to press (Ctrl+F10).
For me the trick was to check "Unpack nested archives" of the .ear in the File->Project Structure:

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.

Resources