Missing file in res>layout - android

I'm currently using eclipse to build android apps, but according to the tutorial, there will file named main.xml in res>layout to create the design of my apps. However my layout is empty.

I had posted about the same issue with extra information, but it was deleted. However, I found a solution so you can get the layout folder populated with the blank activity.
Instead of using the ADT package, download Eclipse and the SDK separately. Follow the details here, but download and unpack the SDK first. Click the DOWNLOAD FOR OTHER PLATFORMS link.
You will also need the location of your java JRE bin folder.
I hope that helps,
Lee.

Create a new project based on a template and everything will be set up as expected. It sounds like you may be new to Android. I would suggest reading through the documentation for building your first app. It will tell you all you need to know.
https://developer.android.com/training/basics/firstapp/index.html

Related

Save android studio activity on separate file

I had created a bulky activity and now I need to modify a lot in it. I decided to first copy paste the entire code on text box but I do not think it is the right way. I want to save the activity consisting of xml file and .java file in a single file that can be recalled if required. Is this possible or should I copy and paste both file to some location manually.
Thanks
In modern Software development it is often a good practice to use some kind of version control system.
A lot of people are using systems based on git like GitLab, GitHub, BitBucket etc.
These tools help to manage your source code in different versions and enable you to switch between versions easily.
In your case you could decide to work with github and after pushing your project you could compare your recent code with the new one until you decide your refactoring is done.
If you decide to dive into this you find many tutorials with google.
e.G https://www.codecademy.com/learn/learn-git

There is no "res/layout/" folder in my android project (using eclipse, libGDX)

I want to add ads to my aplication via adMob, so I followed this tutorial: https://developers.google.com/mobile-ads-sdk/docs/admob/fundamentals?hl=de#play
It says:
// Lookup your LinearLayout assuming it's been given
// the attribute android:id="#+id/mainLayout".
But I have no layouts! Not even a layout folder!
I tried this solution, but it did not work for me: src folder empty on creating new Android project
There was allready everything installed and uninstalling and then installing again also didn't work.
I guess it might have something to do with the gradle-project. I created the project with the gdx-setup tool. But I don't know anything about gradle.
I hope someone can help me.
You don't need to create a layout folder you can do it all programatically.
Look at our open source libgdx game for an example:
https://github.com/MapleScotDevelopment/LoggerBill

Android & iOS: Best way to create multiple similar apps

I've created an app which pulls data from a JSON file and displays it.
Now that app is specific for one sports team. I want to create the same app for 10 other teams.
Plus there will be an accompanying pro version of the app.
I'll be doing the same thing for the iOS version.
The only difference between the apps will be colors, logos and url of the data source.
I wanted to know if there was a better way to create apps. Instead of individually creating 40 different projects.
It will help me in updating the app as opposed to copy pasting the same code 40X.
Are there any special features available in eclipse and xcode to do that?
Thanks
I would simply swap out the resources for each team and rebuild the app.
For example, with Android, maintain an AndroidManifest.xml and a res/ subdirectory tree for each team. When it is time to build, simply copy over the resources into the project, overwriting the previous team.
I don't know of any existing tool to do this automatically, however.
Have you looked into using PhoneGap and just create a "mobile site" that detects the app that is connecting and adjusts the data/styles accordingly.
There's always the possibility of creating ONE app allowing the user to set the team preference upon first load, and swapping out resources programmatically.
With Titanium Studio you can write code using Javascript and it convert your code in native objective-c code, native android code, native html 5 code and soon also in windows phone code. It`s the best free cross platform IDE
Upon reviewing your responses, you seem to want a strategy to manage your resources. Since different OS has different resource requirements (screen-size, iOS 2x png for example). The most common strategy is to keep a separate resource structure and setup build target to copy/xcopy replace these image resources before build. Source control + an OSX build server would be most beneficial.
After creating these apps I've found the following way to be the most easiest way to create a similar app.
Android:
1. Select the project from the project explorer sidebar copy it and then paste it. Give it a new name.
Select the new project and then right click > Android Tools > Change Package Name.
Give it a new package name. Eclipse will give you an option to refactor the code, say yes.
Go to res/values and change all strings.
Change the icons and other images.
Go to src click the package and then refactor it. Give it the new package name.
Go to manifest file and rename any old names which might still be lingering.

How do you change the default subdrectories in an Eclipe ADT project?

I would like to be able to change the default subdirectories created as part of an Eclipse ADT project. That is, instead of "res" and "bin" I would like to have something else.
With most kinds of Eclipse projects it seems pretty straightforward -- there are a few places where you go to change different core subdirectories, you go there and change them, and that's pretty much that.
With the ADT plugin for Eclipse, it seems that if you refactor "res" to "resources" for example a new folder called "res" gets automatically added anyway. The same seems to be true for "bin" and "gen."
Where do I start to look to learn more about what causes this automated behavior and how to change it?
I'm not sure you can, as they are strictly defined by Android
http://developer.android.com/guide/topics/resources/providing-resources.html
http://developer.android.com/guide/topics/resources/available-resources.html
Why do you want to change the names?

android c2dm navigate the jumpNote source code

all,when i open jumpNote project in eclipse,i encounter some mistakes like the following description.
many variables related with c2dm like
Config.C2DM_ACCOUNT_EXTRA,
Config.C2DM_MESSAGE_SYNC,
Config.C2DM_SENDER etc
****cannot be resolved.****
i uses the latest sdk(2.2).
any one konws the reasons, i think that if i miss some jar files?
any help is grateful.
You need to check out trunk/src.shared and merge it into the src dir of jumpnote. Then clean/build. If it still doesn't work re-import it into eclipse.
Those are just examples of what you can do in your own app, they don't actually exist within the Android API.
There is a Config class if you browse the source code, com.example.jumpnote.android.Config.java

Categories

Resources