Month: June 2011

  • Inserting youtube video in forum’s post by URL. Youtube BBCode.

    Inserting youtube video in forum’s post by URL. Youtube BBCode.

    Hello,

    Yesterday i needed BBCode which inserting Youtube.com video by URL, not by video ID. I don’t found this 🙂

    Here i show you my BBCode.

    BBCode usage:

    [youtube]{URL}[/youtube]

    HTML Replacement:

    <script type="text/javascript">
        var s = '{URL}';
        var s2 = s.split("?v=")[1].split("&")[0];
        document.write('<iframe width="425" height="350" src="https://www.youtube.com/embed/' + s2 +'?rel=0" frameborder="0" allowfullscreen></iframe>');
    </script>
  • How to run Android application then you use Maven in your project

    How to run Android application then you use Maven in your project

    Then i first tried use Maven in my Android projects i have some discomfort then run my applications with

    mvn clean install android:deploy

    and then all is successful i can see my app bringing to front of my device which i can see then run standard Android apps with Run As..–>Android Aplication in Eclipse.

    This instruction will works only in Linux. If you use Windows you need to rewrite some scripts according to your OS shell script language

    I find some solution of this little problem.
    First you need Exec Maven Plugin existing in your pom.xml

    <plugin>
        <artifactId>exec-maven-plugin</artifactId>
        <groupId>org.codehaus.mojo</groupId>
        <configuration>
            <executable>${basedir}/scripts/run_app.sh</executable>
        </configuration>
    </plugin>

    Next create scripts dir in your project. That dir  need to heve run_app.sh bash file with next content:

    adb shell am start -a android.intent.action.MAIN -n your.app.package/.YourMainActivity

    Go to scripts dir in your terminal and make this file executable by all with

    sudo chmod '777' run_app.sh

    That all. Next you need to execute next in your terminal then located in project root dir (same level as pom.xml)

    mvn clean install android:deploy; mvn exec:exec

    Hope it will useful for you

    Project you can download below.
    Just untar and import as Existing Maven Project in your Eclipse.

    Download it from github