Schlagwort-Archive: android

Add Admob jar to local Maven Repository

I do not find the dependency declaration for googles Admob at Maven Central.
Download the jar https://developers.google.com/mobile-ads-sdk/download#downloadandroid
Install AdMob in my local m2 Repository to use the Dependency

ingoreschke$cd Downloads/GoogleAdMobAdsSdkAndroid-6.4.1/
ingoreschke$ mvn install:install-file -Dfile=GoogleAdMobAdsSdk-6.4.1.jar 
-DgroupId=com.google.ads
-DartifactId=admob 
-Dversion=6.4.1 
-Dpackaging=jar

refer it in your pom using

<dependency>
	<groupId>com.google.ads</groupId>
	<artifactId>admob</artifactId>
	<version>6.4.1</version>
</dependency>

Source:
http://stackoverflow.com/questions/12873586/how-to-download-and-install-jar-in-my-local-repo-maven

Alternativly you can create a helper POM in same directory

<?xml version="1.0" encoding="UTF-8"?>
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.ingoreschke</groupId>
    <artifactId>install-admob</artifactId>
    <version>1.0.0</version>
    <!--Helper POM for installing admob to local repo-->
    <build>
        <defaultGoal>install:install-file</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <file>GoogleAdMobAdsSdk-6.4.1.jar</file>
                    <groupId>com.google.ads</groupId>
                    <artifactId>admob</artifactId>
                    <packaging>jar</packaging>
                    <version>6.4.1</version>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

call mvn

mvn

Source:
http://www.michenux.net/android-admob-tutorial-461.html

maven android eclipse

prerequired:

  • Maven3 installed
  • Eclipse 3.7 or greater
  • maven – plugin
  • android plugin

create sturcture with maven.
Terminal:
go to Project Folder.

mvn archetype:generate | grep android
46: remote -&gt; com.googlecode.android-player-root-archetype:parent-archetype (-)
110: remote -&gt; com.vektorsoft.demux.tools:demux-android-archetype (Create Android application structure for DEMUX Framework applications)
117: remote -&gt; de.akquinet.android.archetypes:android-gcm-quickstart (Creates a skeleton for a GCM Android application)
118: remote -&gt; de.akquinet.android.archetypes:android-library-quickstart (Creates a skeleton for an Android library)
119: remote -&gt; de.akquinet.android.archetypes:android-quickstart (Creates a skeleton for an Android application)
120: remote -&gt; de.akquinet.android.archetypes:android-release (Creates a skeleton for an Android application,
121: remote -&gt; de.akquinet.android.archetypes:android-with-test (Creates a skeleton for an Android application and instrumentation tests)
122: remote -&gt; de.akquinet.android.archetypes:stand-archetype (Creates a skeleton for an Android application using the Stand framework stack)
531: remote -&gt; org.eclipse.xtend:xtend-android-archetype (-)
826: remote -&gt; ru.nikitav.android.archetypes:release (-)
827: remote -&gt; ru.nikitav.android.archetypes:release-robolectric (-)
^C

Keep ID 119 in mind and enter it.

Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 296: 119

Choose a version (latest recommend)

Choose de.akquinet.android.archetypes:android-quickstart version: 
1: 1.0.0
2: 1.0.1
3: 1.0.2
4: 1.0.3
5: 1.0.4
6: 1.0.5
7: 1.0.6
8: 1.0.7
9: 1.0.8
10: 1.0.9
11: 1.0.10
12: 1.0.11

Define a groupId, artefactId, version, package etc. and confirm with Y:

Define value for property 'groupId': : de.ingoreschke.annuitycalculator
Define value for property 'artifactId': : app-full
Define value for property 'version':  1.0-SNAPSHOT: : 1.0.0
Define value for property 'package':  de.ingoreschke.annuitycalculator: : de.ingoreschke.annuitycalculator.full
Define value for property 'android-plugin-version':  3.6.0: : 
Define value for property 'emulator':  not-specified: : 
Define value for property 'platform':  16: : 17
Confirm properties configuration:
groupId: de.ingoreschke.annuitycalculator
artifactId: app-full
version: 1.0.0
package: de.ingoreschke.annuitycalculator.full
android-plugin-version: 3.6.0
emulator: not-specified
platform: 16

New Module in Main pom.xml

<?xml version="1.0" encoding="UTF-8"?>
  2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.o
  3   <modelVersion>4.0.0</modelVersion>
  4   <groupId>de.ingoreschke</groupId>
  5   <artifactId>annuitycalculator</artifactId>
  6   <version>0.0.1-SNAPSHOT</version>
  7   <packaging>pom</packaging>
  8   <name>Main Project Folder</name>
  9   <description>This will be hold all sub projects Android, Java, Website to Annuity Calculator Project</description>
 10   <modules>
 11     <module>core</module>
 12     <module>app_full</module>
 13   </modules>
 14 </project>

Pom.xml in new Project app_full

<?xml version="1.0" encoding="UTF-8"?>
  2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.o
  3     <modelVersion>4.0.0</modelVersion>
  4     <parent>
  5     <artifactId>annuitycalculator</artifactId>
  6     <groupId>de.ingoreschke</groupId>
  7     <version>0.0.1-SNAPSHOT</version>
  8   </parent>
  9     <groupId>de.ingoreschke.annuitycalculator</groupId>
 10     <artifactId>app_full</artifactId>
 11     <version>1.0-SNAPSHOT</version>
 12     <packaging>apk</packaging>
 13     <name>app_full</name>
 14     <properties>
 15         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 16         <platform.version>4.1.1.4</platform.version>
 17         <android.plugin.version>3.6.0</android.plugin.version>
 18     </properties>
 19     <dependencies>
 20         <dependency>
 21             <groupId>com.google.android</groupId>
 22             <artifactId>android</artifactId>
 23             <version>${platform.version}</version>
 24             <scope>provided</scope>
 25         </dependency>
 26     </dependencies>
 27     <build>
 28         <finalName>${project.artifactId}</finalName>
 29         <pluginManagement>
 30             <plugins>
 31                 <plugin>
 32                     <groupId>com.jayway.maven.plugins.android.generation2</groupId>
 33                     <artifactId>android-maven-plugin</artifactId>
 34                     <version>${android.plugin.version}</version>
 35                     <extensions>true</extensions>
 36                 </plugin>
 37             </plugins>
 38         </pluginManagement>
 39         <plugins>
 40             <plugin>
 41                 <groupId>com.jayway.maven.plugins.android.generation2</groupId>
 42                 <artifactId>android-maven-plugin</artifactId>
 43                 <configuration>
 44                     <sdk>
 45                         <platform>16</platform>
 46                     </sdk>
 47                 </configuration>
 48             </plugin>
 49         </plugins>
 50     </build>
 51 </project>
<pre>
 
<pre lang="bash">mvn clean install

In Eclipse
Import the new Maven Modul.
After Import I got a Error:
Project 'app_full' is missing required source folder: 'src/test/java'
Fixed it by adding a folder test/java into src.
Bildschirmfoto 2013-09-11 um 00.28.35

Source: a screencast found on youtube. http://www.youtube.com/watch?v=S7XDsivkVUA

Android eigene Klingeltöne, Alarms, Benachrichtigungstöne etc.

Anleitung für eigene Klingeltöne.

Auf der SD Karte folgende Ordner anlegen

media/audio/music
media/audio/ringtones
media/audio/notifications
... weitere wenn erwünscht.

Dann einfach die gewünschten Töne in die entsprechenden Ordner kopieren.
Danach werden die Töne in den Auswahllisten für Klingeltöne und Benachrichtigungstöne angezeigt.

Anlegen und kopieren entweder über den angeschlossenen Computer (USB-Kabel oder Bluetooth) oder
einen Fileexplore – zum Beispiel ASTRO – installieren
Dort dann unter sd die Ordner anlegen
Per Mail oder Download die Töne aufs Handy und in die entsprechenden Ordner kopieren.

Siehe
http://developer.android.com/guide/topics/data/data-storage.html#filesExternal

Music/ – Media scanner classifies all media found here as user music.
Podcasts/ – Media scanner classifies all media found here as a podcast.
Ringtones/ – Media scanner classifies all media found here as a ringtone.
Alarms/ – Media scanner classifies all media found here as an alarm sound.
Notifications/ – Media scanner classifies all media found here as a notification sound.
Pictures/ – All photos (excluding those taken with the camera).
Movies/ – All movies (excluding those taken with the camcorder).
Download/ – Miscellaneous downloads.

Siehe auch hier http://www.android-hilfe.de/t-mobile-g1-forum/482-klingeltoene.html