Search This Blog

Friday, November 28, 2014

Ubuntu 14.04 - how to create shortcuts in unity launcher

To create a shortcut to an application in unity launcher just make in a symlink in one of the following locations:

/home/user/.local/share/applications

or

/usr/share/applications

or

/usr/local/share/applications

Example command:

ln -s /home/user/applicationsFolder/app1 /usr/share/applications/app1






Build Android apps as Chrome apps/extensions, Build Android apps for ChromeOS, configure build server

What I want to accomplish is configure a build server (like TeamCity) to build an Android application from source and convert it to a chrome extension that can be published on Chrome WebStore as an application.

First of all you can read this source which explains how to run android apps in chrome.

1. Download ARChon runtime and install it as an extenion in Chrome.

2. You can convert your apk manually with this chrome extension - Twerk

3. To enable Chrome App Launcher on Ubuntu (speeds up app launching) - follow this link.

4. Install chromeos-apk
asdsa

  1. In a terminal, run the following command: sudo apt-get install npm
  2. (Ubuntu only): Run the following command: sudo apt-get install lib32stdc++6
  3. Download node.js.
  4. Unzip the tar.gz file you downloaded from the above link.
  5. Per the README file, open a terminal to the unzipped folder containing node.js. And run the following commands in order:
    1. ./configure
    2. make
    3. make install
  6. Run the command: sudo npm install chromeos-apk -g
  7. To make sure you're updated to the latest version (now or in the future), run: sudo npm install -g chromeos-apk@latest
5. Convert your compiled application in apk to chrome app with:

chromeos-apk --tablet --scale --name ApplicationName application.apk


5. Remember - to update the chromeos-apk plugin just run:

sudo npm install -g chromeos-apk@latest

Thursday, November 27, 2014

Install CyanogenMod 11 on XPeria P running stock Android 4.1

1. First of all you need to unlock your bootloader. [worked]
Go developer_sony to proceed with unlocking (official SONY's website)

  1. In your device, open the dialler and enter *#*#7378423#*#* to access the service menu.
  2. Tap Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then you can continue with the next step. If it says No, or if the status is missing, your device cannot be unlocked.


2. Then you need to root your XPeria P [worked]
The following root method worked for me:
DooMLoRD Easy Rooting Toolkit (v17)


3. To install CWM [worked]

CWM xda link
You need to have root access in order to use this method.
It worked fine for me.

CyanogenMod 11 did NOT install from CWM for me. It started fine and then couldn't read the phone model number properly.


4. To install TWRP [did not work as expected]

extract boot.img from cm-11-20141012-SNAPSHOT-M11-nypon.zip and copy it to the main script directory.

flash the boot image in fastboot mode with:
sudo fastboot flash boot boot.img


4. Cyanogemod 11 link

http://forum.xda-developers.com/xperia-u/p-development/rom-cyanogenmod-11-0-t2626639


Workaround:
After 1,2,4 (After flashing boot.img )
enter CWM and try to flash CyanogenMod. The device will restart and enter bootloop. Try pressing power button to enter TWRP.
Then flash cyanogenmod normally.


HOW TO ENTER RECOVERY MODE in Xperia P

howto

CyanogenMod:
1.press power + volume up for 3 seconds until the phone vibrates
2. keep on pressing volume up multiple times until clockworkmod recovery shows

TWRP
1.press power + volume up for 3 seconds until the phone vibrates
2. keep on pressing power until twrp shows

Monday, October 20, 2014

Android Annotations - create @EBean instance from code; Android Annotations inject from code; create instance dynamically

Usually when you need an instance of @EBean you simply use inversion of control:

@EBean
public class Upgrade0001 implements IUpgrade {

    @Bean
    protected SDao mSDao;
}


@EActivity(R.layout.activity_some)
public class SomeActivity extends Activity {
    @Bean
    protected Upgrade0001 mUpgrade0001;
}


but what if you wanted to dynamically create an instance of @EBean from code?

Simple reflection won't help - mSDao will be null:


IUpgrade upgrade = (IUpgrade) Class.forName("Upgrade0001_").newInstance();


Just call the getInstance_ method which every AndroidAnnotations class implements:


Method m = Class
                         .forName(upgradeItem.getUpgradeClassName())
                         .getMethod("getInstance_", Context.class);

Object result = m.invoke(null, this.getApplicationContext());
IUpgrade upgrade = (IUpgrade)result;

Thursday, July 24, 2014

Ubuntu 14.04 - convert multiple images to *.pdf

To convert all (multiple) images in a folder to a single pdf file you can just type:


convert -compress jpeg * output_file.pdf


inside the folder with the photos.



Tuesday, July 22, 2014

Ubuntu 14.04 - install BIMP - Batch image manipulation

BIMP is useful to apply filter to multiple images in GIMP.

HOW TO INSTALL BIMP on Ubuntu 14.04 x64

sudo apt-get install libgimp2.0-dev
(optionally:
sudo apt-get build-dep gimp)

make
make install


Homepage: http://registry.gimp.org/node/26259

Compiled binary for Ubuntu 14.04 x64
download

just copy this binary to:
~/.gimp-2.8/plug-ins/bimp
chmod 772  ~/.gimp-2.8/plug-ins/bimp





Wednesday, July 2, 2014

Android L preview Emulator under UBUNTU 14.04 x64 & Windows 7 x64 - optimal settings

UBUNTU 14.04 x64:

 sudo apt-get install cpu-checker


$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used


sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils

export LD_LIBRARY_PATH=/home/your_user_name/Develop/android-sdk/tools/lib:$LD_LIBRARY_PATH

sudo apt-get install libgl1-mesa-dev

sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so





Start the emulator with:

./emulator-x86 -avd your_avd_name -qemu -m 2047 -enable-kvm

1) select Intel Atom (x86) - for VT-x to work
2) skin - select WVGA800 - for other skins the emulator is too big/small
3) remember to check "Use host GPU"



WINDOWS:

Install:
Intel(R) Hardware Accelerated Execution Manager (HAXM)
with Intel(R) Virtualization Technology (VT)

It's really a must. Without HAXM the emulator is dead slow. Also remember to enable VT-x on your mainboard's BIOS settings for HAXM to work.

1) select Intel Atom (x86) - for VT-x to work
2) skin - select WVGA800 - for other skins the emulator is too big/small
3) do not set more than 700 MB of RAM - Windows does not handle that well
4) remember to check "Use host GPU"