Cordova Android Build of icon path not found - android

On typing cordova build android in a DOS box, nothing is built, but instead I see an error message:
Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png
I have updated Cordova, android rm & add everything still no luck. I am a native android developer feeling very hard to learn Cordova hybrid app development please guide me to descriptive link too.

If you project is created using Ionic then do the following :-
Create the folder name "resources" in your projects root directory.
Place your icon file name as "icon.png" in the resouces folder.
Icons should be 192x192 px without rounded corners.
Place your splash file name as "splash.png" in the resources folder.
Splashscreens should be 2208x2208 px, with the image centered in the
middle.
After doing the above open you cli , go to the root of your project and enter
ionic cordova resources
your icon and splash will be generated and config file also will be updated.
If you have created this project using cordova/phonegap :-
you can either remove the icon tag you specified in your config.xml completely
or
create the icon and place it in "www/res/icon.png".
Update the path in config.xml
remove all the icon path and just add this line to your config.xml
<icon src="www/res/icon.png"/>

Related

Could not find configuration file (pubspec.yaml) on windows

I'm using flutter with Dart on AndoidStudio, tried to add image to my app and to do so I need to
find pubspec.yaml file so that I can add image directory but the problem is that there is no pubspec.yaml file in my project files.
enter image description here
the image you uploaded shows your android folder. Open your project folder which will contain pubspec.yaml file along android, ios folder etc.

Android - How do I create the assets folder manually?

I'm new to Android development, and I'm trying to manage projects from the command line using the SDK since I cannot get Android Studio 1.2 to work properly in my system (it's unresponsive).
The problem: I created a new project but the asset folder is missing.
Other SO answers (enter link description here) solve this by creating the folder from the IDE, or by pointing to the asset folder in the .iml file, with doesn't work in my case (I trying to mange the projects from the command line entirely)
There's also a solution editing build.gradle, but the project created from command line (using the SDK) doesn't seem to be a gradle project.
Any help would be appreciated.
Just create a directory called "assets" at the root of your project, i.e. in the same directory your AndroidManifest.xml lives. There's no need to "link that folder from the project". At least that's the case on my system, where I'm using Android SDK 24.4.1 (and I'm not using Gradle -- just emacs and ant).
Once I had assets/fonts/aisauc.ttf in there, the following code...
import android.graphics.Typeface;
...
Typeface greek =
Typeface.createFromAsset(getAssets(), "fonts/aisauc.ttf");
mytextfield.setTypeface(greek);
gave me a TextField with characters from the font I wanted.
How do I create the assets folder manually?
You make it the same you make any directory on your filesystem. Whether you use mkdir or a command-line equivalent, or whether you use your desktop OS's file manager, is up to you.
The default location for an assets/ directory is in a sourceset (e.g., src/main/assets/, to go along with src/main/AndroidManifest.xml and src/main/res/ and src/main/java/, where src/main/ is a sourceset). You can have an assets/ directory located elsewhere, if you choose, but then you will need to configure your build.gradle file to teach Gradle the alternative assets/ location for whatever sourceset you are trying to apply it to.
In your left most sidebar or the sidebar that shows the app, manifests, java... etc, right click app > New > Folder (has the green android symbol next to it) > Assets Folder.
On the next screen leave the path as 'main' and click 'Finish'. Then you can drop whatever asset you want into the folder.

phonegap icon/splash screen path for cli build

While creating my app I issues the command:
phonegap create appdir com.site.myapp myapp
so now the appdir folder has the following.
-.cordova
-hooks
-platforms
-plugins
-www
-config.xml-----(config.xml is generated at top level)
In my www folder i have one index.html and one image that I want to use as my icon
www
-index.html
-icon.png
1)so which do I give the path for the tag in the config.xml file?
2)where do I put the config file do i need to move the config file inside the www folder like in phonegapbuild
I have tried various path combinations but none is working
Using Android, The application icon is located here: res/drawable/
So replace icon.png there.
Same thing for splash screen, replacing res/drawable/screen.png.

Phonegap + Eclipse + Cordova -- No config.xml

I just created an Android Project in Eclipse with all the phonegap and cordova files as expected. However, I have no such directory, and thus, no config.xml. According to the Apache Cordova documentation, it is supposed to be located at: app/res/xml/config.xml.
My folder structure is as follows, for the /res directory:
/res/drawable-hdpi
/res/drawable-ldpi
/res/drawable-mdpi
/res/drawable-mdpi
/res/layout
- /res/layout/main.xml
/res/values
- /res/layout/strings.xml
What have I done wrong or what step am I missing? I hope I have provided enough information.
Just create the /res/xml/ folder manually. Then create config.xml using a text editor and use this as a template: https://github.com/phonegap/phonegap/blob/master/lib/android/xml/config.xml
Whenever we create a cordova project, config.xml gets created automatically. We need to check if there is any folder in excluded list.
Go to Build path -> Resources -> Check for excluded resources.
Remove them from the project and build the project. You will be able to view the config.xml and www folder in the Project/Package Explorer.

Appcelerator titanium push Notification using C2DM?

I am using Appcelerator Titanium Version 1.8.0 have anyone tried push notification using google's C2DM.if so help me to create Sample push notification.
It is not that difficult: Here is steps for it...
Clone project from github
Find build.properties
Modify all paths to fit the paths (and versions) in your environment
Optionally you need to download and install the android sdk from here http://developer.android.com/sdk/ndk/index.html
Open console in module root and type ant and hit enter
The build process should end with something like build successfully
In the module directory, you will find the build result in the dist folder
Open that folder, unzip the com.findlaw.c2dm-android-0.1.zip
A folder is created: modules/android/com.findlaw.c2dm/0.1
copy the content of modules/android/com.findlaw.c2dm/0.1 to the folder [your_project]/modules/android/com.findlaw.c2dm/
Copy timodule.xml to the root folder of your project (where the tiapp.xml is located)
Open tiapp.xml and replace all occurences of com.findlaw.c2dm with your app id, except of the line including this:
com.findlaw.c2dm.C2DMReceiver
Register the module in tiapp.xml:
<modules>
<module platform="android" version="0.1">com.findlaw.c2dm</module>
</modules>
14. Use the module in your code as described in the example of the module
For more check this communication of our team member...
Your Module folder should not inside the Resource folder

Categories

Resources