mandag den 24. august 2015

Problem with the accelerator for Android Virtual Devices

If you have problem with the accelerator for Virtual Devices try this:
  • go to Android SDK normal "C:\Users\USERMAME\AppData\Local\Android\sdk" (replace USERMAME with your windows username) 
  • then go to the folder folder "extras\intel\Hardware_Accelerated_Execution_Manager"
  • finaly run program  intelhaxm-android.exe

More about the accelerator to be find here:
More about problems and how to set up your PC for virtualisation.

søndag den 23. august 2015

Speed Up Android Studio

Speed Up Android Studio

-Launch: Notepad++ as administrator
-Open: C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions
There are a lot of parameters, but we are interested in memory-related parameters:
-Xms: Specifies the initial size, in bytes, of the memory allocation pool.
-Xmx: Specifies the maximum size, in bytes, of the memory allocation pool.
-XX:MaxPermSize: Size of the Permanent Generation.
-XX:ReservedCodeCacheSize: Reserved code cache size
Now, I’m using the following values:
-Xms1024m
-Xmx2048m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=512m

Speed Up Gradle

Gradle is the new build system used in Android Studio
Now, we will configure the global settings of Gradle:
  • Goto: C:\Users\<UserName>\.gradle
    make a new file called “gradle.properties”
  • Add the following lines to the file:
    org.gradle.parallel=true
    org.gradle.daemon=true
  • Launch Android Studio and goto File -> Settings -> Gradle then enable “Offline work”
  • Restart Android Studio and check if there is any Speed Improvement.

fredag den 21. august 2015

Problem with shotdown and statup of virtual device


Sometime you end up with a hanging device. I have discovered the problem, when i change resolution om my pc fx using the projector. At this point the virtual device  abort and can't start again.

Solution:

Device from AVD installed with the Android SDK:

Find the SDK - normaly it will be in "C:\Users\xxx\.android\avd" where xxx is your username.
Find the virtual device and delete all files starting with lock extention

I have made myself a commandfile with the content til make it easy
------------------
CD C:\Users\bjbu\.android\avd
RMDIR *.lock* /s
pause

Genimotion device:
Start VirtualBox manager and stop the virtual mashine from here

onsdag den 25. februar 2015

Genemotion is Cool fast virtual Android device running in a Virtual Box, with lots of features.

Genemotion is Cool fast virtual Android device running in a Virtual Box, with lots of features.

Read more here:
https://www.genymotion.com/?utm_source=dlvr.it&utm_medium=twitter#!/developers/user-guide

Interacting with virtual devices

This section describes features that help you easily interact with your virtual devices.

Multi-touch simulation

Because in most cases, virtual devices are controlled with mouse and keyboard, some shortcuts have been implemented to help simulate common gestures:
  • Zoom in: right click + move mouse to the left
  • Zoom out: right click + move mouse to the right
  • Tilt forth: right click + move mouse up
  • Tilt back: right click + move mouse down
  • Clockwise rotation: Shift + right click + move mouse to the right
  • Counterclockwise rotation: Shift + right click + move mouse to the left
If you use Mac OS X, replace right click with ctrl + click.

Drag and drop

To drag and drop files from your computer to the virtual device, ADB must be installed. To configure ADB, please refer to section ADB. The behavior of dragged and dropped files is different according to the file type:
  • Regular files: regular files are stored in /sdcard/Download.
    They can be accessed via the File Manager application provided in the virtual device.
  • Android applications: APK files are installed on the virtual device.
    If the same application already exists but with another signature, you can decide to override the existing application.
  • Flashable archives: zip archives detected as flashable (containing a /system folder) are flashed on the device.
    Flashable archives may damage your virtual device. We recommend restarting your virtual device after flashing an archive.

Copy and paste

The clipboard is shared between your computer and Genymotion. Thus, you can easily copy and paste text from your computer to Genymotion, and vice versa.

Increase/Decrease volume

You can control the volume of the sound emitted by your virtual device:
  • Click  to increase the volume.
  • Click  to decrease the volume.

Rotate screen

You can rotate the screen of your virtual device by clicking .
Depending on the Android version and the density of your virtual device, the Rotate screen feature may not be available. If you are using an Android version 4.2 or above, make also sure that the Rotate screen feature is not locked in the right-hand bar. Rotation might also be locked in portrait or landscape mode by the current running application. In this case, it is not possible to change it via the Rotate screen button or via the rotation setangle command in Genymotion Shell.

Pixel Perfect

With Pixel Perfect, you can be highly precise in the development of your user interface and ensure every pixel of your application really looks as it should. One pixel of the virtual device is displayed using one pixel of your computer screen.
This feature is only available with Indie and Business licenses.
Click  once to activate Pixel Perfect. Click twice to deactivate it.
If the virtual device screen size is larger than your computer screen size, the virtual device window will be maximized and you will be able to use scrollbars to move inside the screen.

Navigation buttons

With the navigation buttons, you can navigate between applications or display available actions that can be performed.
  • Back
    Click  once to go back to the previous page. Click twice to exit the application.
  • Recent apps
    Click   to display the recently used applications.
  • Menu
    Click  to display the actions you can perform within an application.
  • Home
    Click  to display the home page at any time.
  • Power
    Click  to shut down the current virtual device.

Display tips

When navigating within a virtual device, you can at any time change its display:
  • Full-screen mode: you can switch to full-screen mode by pressing F11. Pressing a second time reverts to the original screen size.
    On Mac OS X, you may have to use the key combination ctrl +  fn + F11.
  • Custom size: you can resize the virtual device window by selecting and dragging an edge or a corner of the window.
  • Fit to content: when the virtual device window is resized, black areas appear on the borders. Double-click in one of those areas to fit the virtual device window size to its content.

More Activities and Intent to start an Activity

If you make APPs with more than one view/pages of data, basic you would make new activities - one per page. And you use use Intent to console / start the activities.
  • More complex solutions use fragments, but I have no concerns about that right now.
  • You could find more about Intents here:

Sone of my own examples with Intents and more activities.