Search This Blog

Thursday, February 20, 2014

Adding Unmanaged Dependencies to a Maven Project

Adding Unmanaged Dependencies to a Maven Project

To add a local jar to maven build you need to deploy it to your project's local repository (that's NOT your local maven's repository placed in home/user/.m2 folder).

Adding the jar file as a system dependency won't work as the jar would have to be copied by hand to every device where you want to install your application.

Changing local system dependency to maven's local project repository:

            <dependency>
            <groupId>com.wagnerandade</groupId>
            <artifactId>coollection</artifactId>
            <version>0.2.2</version>
            <scope>system</scope>
            <systemPath>${project.basedir}/lib/coollection-0.2.2.jar</systemPath>
        </dependency>

Use the command to register a local project repository:

mvn deploy:deploy-file -Durl=file:///android/myapplication/repo/ -Dfile=coollection-0.2.2.jar -DgroupId=com.wagnerandade -DartifactId=coollection -Dpackaging=jar -Dversion=0.2.2



and change the pom to:

          <repositories>
        <repository>
            <id>project.local</id>
            <name>project</name>
            <url>file:${project.basedir}/repo</url>
        </repository>
    </repositories>

[...]

        <dependency>
            <groupId>com.wagnerandade</groupId>
            <artifactId>coollection</artifactId>
            <version>0.2.2</version>
     </dependency>


PDF tutorial



Thursday, February 13, 2014

Android - Integrate scaloid with android annotations, maven and proguard

I managed to integrate Scaloid with android annotations, maven and proguard. The resulting "hello world" project contains:
- main start Activity written in SCALA
- second activity written in SCALA which uses Java classes (example of JAVA & SCALA integration)
- third activity is written in Java and uses Android Annotations
- all in obsfuscated & profiled with ProGuard
- project compiles from maven

Project: here



Wednesday, February 12, 2014

IntelliJ 13 + ProGuard + Android Annotations on Android

Proguard configuration working with:
IntelliJ 13 & Android Annotations

download

ProGuard 4.11
Android annotations 2.7.1

Settings:







Tuesday, February 11, 2014

IntelliJ 13 + Scaloid + maven 3

Some helpful links:

Scaloid:  https://github.com/pocorall/scaloid
Scaloid maven project:  https://github.com/pocorall/hello-scaloid-maven
or https://github.com/kosiara/hello-scaloid-maven
Mavenhttp://maven.apache.org/
Intellij 13http://www.jetbrains.com/idea/
JDK 6: JDK_6
Android API level 8:  http://developer.android.com/sdk/index.html


1. Download&install&set up - maven, intellij 13, Android SDK
2. Install JDK 6 alongside JDK 7 (in my case it was: /usr/lib/jvm/jdk1.6.0_45 )
3. Download API level 8 SDK platform for Android from Android SDK Manager
(adt-linux-x64/sdk/tools/android ), set ANDROID_HOME env variable
4. Clone scaloid maven project repository
5. mvn package -Prelease  in the scaloid maven project
6. Run IntelliJ, install SCALA plugin (worked for me on version:  0.30.380 and 0.26.361)
7. Close IntelliJ, choose Open Project,  navigate to the project directory and open the pom.xml file (hello-scaloid-maven/pom.xml)

upon question:

Language level changes will take effect on project reload.
Would you like to reload project "hello-scaloid-maven" now?

select Yes. Android framework will be loaded.

8. Change project settings according to the attached images.

















Errors:

Unable to execute dex: method ID not in [0, 0xffff]: 65536

Your ProGuard configuration DID not work. Scala has too many methods for dex compiler. Dex has a limit of 65536. ProGuard limits the number of SCALA methods and so the dex compiler succeeds in processing the class files.




Monday, February 3, 2014

HTML :textile advanced table layout

In this example we're going learn how to:
- create a cell spanning 2 rows
- create a cell spanning 2 cells
- create styled links
- create image with specific height/width


Advanced textile table layout


table(#newstable){width:100%; border:0px;border-collapse:collapse}.
|\2{font-weight:bold;color:#FF6700;width:50%}. Topic 1 |\2{font-weight:bold;color:#FF6700;width:50%}. Topic 2 |
|/3{width:1%}.!{height:120px;width:170px}http://www.android.com/media/android_vector.jpg! 
|{height:22px}<. By: example |/3{width:1%}.!{height:120px;width:170px}http://www.android.com/media/android_vector.jpg! |{height:22px}<. 1111 |
|<. text  |<. 2222 |
|{height:22px}<. "{font-style:italic;color:#FF6700}Read more":http://test.com |{height:22px}<. "{font-style:italic;color:#FF6700}Read more":http://test.com |



Download textile