Thursday, March 17, 2011

Android Location

LocationManager lm = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
Location loc = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (null != loc) {
Double longitude = loc.getLongitude();
Double latitude = loc.getLatitude();
}

A manifiest-be pedig:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />

Ez az utolso csak akkor kell, ha LocationManager.GPS_PROVIDER helyett valami mock location provider-t akarunk hasznalni. Ezt meg valahogy igy tehejuk meg:

String MOCK_LOC_PROVIDER_NAME = "mockLocationProvider";
...
lm.addTestProvider(MOCK_LOC_PROVIDER_NAME, false, false, false, false, false, false, false, 0, 5);
Location location = new Location(MOCK_LOC_PROVIDER_NAME);
location.setLatitude(32.23434);
location.setLongitude(-16.32525);
location.setTime(new Date().getTime());
lm.setTestProviderLocation(MOCK_LOC_PROVIDER_NAME, location);
lm.setTestProviderEnabled(MOCK_LOC_PROVIDER_NAME, true);

Es igy nezhetjuk meg, hogy mar hozzaadtuk-e a sajat location provider-unket (2-szer ugyanazt nem lehet hozzaadni mert akkor hiba lesz):
List providers = lm.getAllProviders();
if (providers.contains(MOCK_LOC_PROVIDER_NAME)) {...}

Wednesday, March 16, 2011

Friday, March 11, 2011

AndEngine

This is the official WiKi for AndEngine -- the free 2D OpenGL Game Engine for the Android platform.

Readonly sdcard AVD-hez

Letrehoztam Eclipse-ben egy AVD-t (Android Virtual Device), de az sdcard-ja readonly volt. Probalkoztam mindenfelevel, de vegul az segitett, ha csinaltam egy uj AVD-t. Nem tudom mit rontottam el elsore, de ez a masodik mar nem volt read only. Itt viszont eloszor tul kicsi-t csinaltam (128 MB) amire nem tudtam felmasolni egy 7 MB-os mp4-et. Amikor csinaltam egy masik AVD-t 1024 MB-os sdcard-dal, akkor arra mar felment ez a file. (Viszont maga az AVD sokkal lassabban keszult el, mert sokaig tartott letrehozni az sdcard.img-t. Raadasul az AVD indulasanal is lassabban tolti be az sdcard-ot, ezert egy ideig itt is readonly-nak tunik.)

Monday, March 07, 2011

Friday, March 04, 2011

Thursday, February 17, 2011

Monday, November 15, 2010

Tuesday, November 09, 2010

forgatas Silverlight-ban

Az volt a feladat, hogy egy videot kellett 90 fokkal elforgatva megjeleniteni Silverlight-ban.

Erre van a PlaneProjection (msdn) ami 3D-ben tud forgatni, de nekunk eleg volt a RotationZ.

Tovabbi peldak:

Thursday, September 09, 2010

David Mendez: Start, Stop, and Restart Windows Services from Mac OS X

Innen.

Mac OS X includes Samba support by default, and this is really handy if you’d like to remotely restart and monitor services running on a Windows machine.

To list services running on the Windows machine, use this command:
net rpc service list -I IPADDRESS -U USERNAME%PASSWORD
A practical example would be:
net rpc service list -I 192.168.0.115 -U Windows%myPassword

After identifying the service you want to restart, you issue the following command to stop the service:
net rpc service stop SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD

Then you can restart (or start) the service by using the following command:
net rpc service start SERVICENAME -I IPADDRESS -U USERNAME%PASSWORD

This is tip that I found on Lifehacker that was aimed at Linux users, but considering Mac OS X has a unix underbelly equipped with samba the command works just the same on a Mac.

Wednesday, June 09, 2010

readerQuotas

Itt kell beallitani, hogy mekkora tombok mehetnek fel-le.

maxArrayLength:
A positive integer that specifies the maximum allowed array length of data being received by Windows Communication Foundation (WCF) from a client. The default is 16384.

maxBytesPerRead:
A positive integer that specifies the maximum allowed bytes returned per read. The default is 4096.

Es a web.config-ban ide kell tenni:
configuration\system.ServiceModel\bindings\customBinding\binding\binaryMessageEncoding\readerQuotas

Friday, May 14, 2010

Thursday, May 13, 2010

Scott Guthrie: Silverlight 2 End to End Tutorial

Silverlight 2 End to End Tutorial: Building a Digg Search Client

To help people come up to speed with Silverlight 2, I've written a simple Silverlight application and put together a series of step by step tutorials that explain the different programming concepts behind it (controls, layout management, networking, data-binding, styles, user controls, templates, etc). I also added a tutorial post that demonstrates how to migrate the application outside of the browser and enable it to run as a desktop application using WPF and the full .NET Framework.

Below are the pointers to the 8 tutorials I've put together:

Wednesday, March 03, 2010

kepek keresese: TinEye

Ha van egy kep valahol es ugyanolyat akarok talalni akkor remekul mukodik a TinEye. Legalabbis filmekbol kivett kepkockaknal.

Wednesday, February 10, 2010

Ha a Finder nem mutatja a kulso meghajtokat

Finder > Preferences.. > Devices / External disks