Search This Blog

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

Tuesday, January 14, 2014

Ubuntu 12.04 - make a DVD ISO from command line


Make a DVD ISO from command line. No additional tools required.

sudo dd if=/dev/sr0 of=image_name.iso


Sunday, January 12, 2014

Ubuntu 12.04 - TeamViewer 8 / TeamViewer 9 - no sound/no microphone. Sound problems

TeamViewer 8 run in Wine so if there is no sound - it's probably wine's configuration fault. In my case I had a standard Intel's integrated sound card in Lenovo Workstation.

To resolve the issue, install wine 1.4 and then configure teamviewer's wine settings:

sudo apt-get install wine1.4

and then:

WINEPREFIX=$HOME/.config/teamviewer8 winecfg


For more details go to:

Configuration:



THE PROCEDURE DOES NOT WORK FOR TEAMVIEWER 9,
On Ubuntu 12.04 I tried:

  • removing puleaudio package
  • installing wine1.6 instead wine1.4 (teamviewer9 runs on wine1.6)

sudo apt-get purge pulseaudio

WINEPREFIX=$HOME/.config/teamviewer9 winecfg

$ sudo add-apt-repository ppa:ubuntu-wine/ppa
$ sudo apt-get update
$ sudo apt-get install wine1.6
$ sudo apt-get install winetricks

Tuesday, December 3, 2013

Arquillian WebSite Ruby HAML use textile filter plugin ERROR

I forked the source code for website from arquillian - code.
It uses several technologies under the hood - starting from Ruby, Bootstrap-sass, HAML and end awestruct.

HAML can interpret textile fragments. Recently, however, the textile and maruku plugin filters have been moved to another gem - haml-contrib.
(news)

After installing ruby 1.9.3 and haml with haml-contrib I received the following error when interpreting *.haml files with the ":textile" fragment:

> haml test.html.haml
Haml error on line 261: To use the "textile" filter, please install the haml-contrib gem.
Use --trace for backtrace.

I tested the application on Ubuntu 12.10. The only way I got it to work is when I compiled yaml, ruby and rubygems from source. The following tutorial from CentOS should be of help:



#preparing packages
$ sudo yum groupinstall 'Development Tools'
$ sudo yum install -y httpd-devel openssl-devel zlib-devel gcc gcc-c++ curl-devel expat-devel gettext-devel patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel make bzip2 zlib1g mysql-server
#compaling libyaml
$ wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
$ tar xzvf yaml-0.1.4.tar.gz
$ cd yaml-0.1.4
$ ./configure --prefix=/usr/local
$ make
$ sudo make install
#compiling ruby 1.9.3
$ wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
$ tar xvzf ruby-1.9.3-p194.tar.gz
$ cd ruby-1.9.3-p194
$ ./configure
$ make
$ sudo make install
#rubygems
$ wget http://rubyforge.org/frs/download.php/76073/rubygems-1.8.24.tgz
OR http://production.cf.rubygems.org/rubygems/rubygems-2.1.7.zip
$ tar xvzf rubygems-1.8.24.tgz
$ cd rubygems-1.8.24
$ sudo /usr/local/bin/ruby setup.rb

sudo gem install bundler

Go to your arquillian directory and:
sudo bundle install


Simulate INTERMEC EA15 barcode scanner via UDP packages

The EA15 intermec barcode scanner sends barcodes as UDP packages. To simulate its behaviour without actually owning the device you can send appropriate packages to the device.

PORT: 4080
barcode prefix: 0000

So to send barcode: 5900116011295
You actully need to send: 00005900116011295
which in HEX is: 30 30 30 30 35 39 30 30 31 31 36 30 31 31 32 39 35

On Windows there is Packet Sender.



On Linux you can easily send udp packages from terminal to simulate barcode scanning:

sudo sendip -p ipv4 -is 10.255.255.14 -p udp -us 5070 -ud 4080 -d "0x3030303035393030313136303131323935" -v 10.255.255.125

where 30 30 30 30 35 39 30 30 31 31 36 30 31 31 32 39 35
is the HEX: 00005900116011295
-is  output IP address
-us  output port number
-v destination ip address
-ud destination port address

to send a simple string do:
sudo sendip -p ipv4 -is 10.255.255.14 -p udp -us 5070 -ud 4080 -d "Hello this is a string" -v 10.255.255.125

The same result can be achieved with the socat command on linux:

echo "00005900116011295" | socat - udp-datagram:10.255.255.125:4080

The scanner looks like this: