Saturday, March 24, 2012

Android: Show soft keyboard with EditText on android

So you wish to show or hide virtual (soft) keyboard in your Android app.

You are executing action that places focus into the EditText field.

You the need to bring up a soft keyboard on your android (or emulator).

Note:
EditTexts are focusable while the system is in 'touch mode'.
The first click event focuses the control, while the second click event actually fires the OnClickListener. If you disable touch-mode focus with:
(xml) View attribute
1
android:focusableInTouchMode
OR
(java)
1
freeText.setFocusableInTouchMode(false);

Then OnClickListener should fire as expected.
--- o --- o --- o --- o --- o --- o --- o ---

To launch the keyboard requires the following additional code:

xml:
------
1
2
3
4
5
6
7
8
9
<EditText android:id="@+id/freeText"
android:layout_width="@dimen/freeTextBox_width"
android:layout_height="@dimen/freeTextBox_height"
android:layout_weight="1"
android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
android:imeOptions="actionSend|flagNoEnterAction"
android:maxLines="4"
android:maxLength="2000"
android:hint="@string/compose_hint"/>


Notice the imeOptions: actionSend|flagNoEnterAction:
The tell you android to apply the SEND button action to the EditText and not to accept ENTER on soft keyboard.

Java:
-------
1
2
3
final TextView freeText = (TextView)findViewById(R.id.freeText);

freeText.setFocusableInTouchMode(true);

FIRST POSSIBILTY USING THE setOnClickListener:
----------------------------------------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
freeText.setOnClickListener(new OnClickListener() {
   
 public void onClick(View v) {
  // Set keyboard
  InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
    // Lets soft keyboard trigger only if no physical keyboard present
    imm.showSoftInput(freeText, InputMethodManager.SHOW_IMPLICIT);
    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
   }
  });

SECOND POSSIBILTY USING THE setOnFocusChangeListener:
-----------------------------------------------------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
freeText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
      public void onFocusChange(View v, boolean hasFocus) {
          if (hasFocus) {
//              getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
           getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
          } else if (!hasFocus) {
           getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
          }
      }
  });

You do not need to use both...they can be implemented for other use.


Jud Luck...


Friday, March 23, 2012

Compiling & Building the GTK+ libraries on UNIX-like systems


Hey you all...

In the past few days I had to install gtk+-3.2.0 so I can share some of my new python code with you to make life a bit easier.
I built a database migration tool in python to ease the migration of old websites databases to open-cart.
The process of installing GTK from sources was long and took some research of all the requires libraries throughout the net.
You will need to get the GLib, Pango, Gdk-Pixbuf, ATK and GTK+ packages to build GTK+.
I put all the needed libs here including their download links.

I had an error while compiling and installing that required pixman-I so I included that as well.

Hope you find this useful and a time saver...

General compile and install:

# unpack the sources

$ gzip -cd glib-2.29.4.tar.gz | tar xvf -                             
OR tar xvzf OR xvfj on the local folder
# change to the toplevel directory
$ cd glib-2.29.4
# run the `configure' script
$ ./configure
# build GLIB
$ make
[ Become root if necessary ]
* The following line is ONLY FOR GLib
$ rm -rf /install-prefix/include/glib.h /install-prefix/include/gmodule.h
# install GLIB
$ sudo make install                                                                   


Details of libraries:




1. GLib-2.30.2

--------------

Introduction to GLib

The GLib package contains a low-level core library. This is useful for providing data structure handling for C, portability wrappers and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system.
This package is known to build and work properly using an LFS-7.1 platform.


Package Information



GLib Dependencies

Required



2. Pango-1.29.4

---------------

Introduction to Pango

The Pango package contains the libpango libraries. These are useful for the layout and rendering of multilingual text.
This package is known to build and work properly using an LFS-7.1 platform.

Package Information



Pango Dependencies

Required


3. gdk-pixbuf

-------------

Introduction to gdk-pixbuf

The gdk-pixbuf library is a toolkit for image loading and pixel buffer manipulation. It is used by gtk+-2 and gtk+-3 to load and manipulate images. In the past it was distributed as part of gtk+-2 but it was split off into a separate package in preparation for the change to gtk+-3.
This package is known to build and work properly using an LFS-7.1 platform.

Package Information



gdk-pixbuf Dependencies

Required




4. atk

------

Introduction to atk

The interface definitions of accessibility infrastructure.

Package Information



5. GTK+-3.2.0

-------------

Package Information


  • Download (HTTP): http://ftp.gnome.org/pub/gnome/sources/gtk+/3.2/
  • Download sha256sum: gtk+-3.2.0.tar.xz - bce3c1a9be6afd7552c795268656d8fdd09c299765a7faaf5a76498bb82ed44c
  • Download sha256sum: gtk+-3.2.0.tar.bz2 - b285074ffefb4ff4364f6dd50fe68c7e85b11293e0c1dd3bdeac56052344dadb
  • Download size: 16.6 MB


resources:

  1. GTK+ 3.2 - http://www.gtk.org/download/linux.php
  2. Glib - http://www.linuxfromscratch.org/blfs/view/cvs/general/glib2.html
  3. Pango - http://www.linuxfromscratch.org/blfs/view/cvs/x/pango.html
  4. gdk-pixbuf-2.24 - http://www.linuxfromscratch.org/blfs/view/cvs/x/gdk-pixbuf.html
  5. atk - http://mail.gnome.org/archives/ftp-release-list/2011-August/msg00068.html
  6. pixman-I - http://cairographics.org/releases/
  7. Compiling the GTK+ libraries, Building GTK+ on UNIX-like systems - http://developer.gnome.org/gtk3/stable/gtk-building.html
GTK+ 3.2, build GTK+ 3.2, GNU, Linux, Unix, Glib, Pango, gdk-pixbuf, atk, pixman-I, build GTK+ 3.2 from sources, python, open-cart, Compiling the GTK+ Libraries, How to compile GTK+ itself

Saturday, March 17, 2012

What does Ubuntu stand for?


Oneness: humanity, you and me both - I am, because U R..

Ubuntu is a Nguni word which has no direct translation into English, but is used to describe a particular African worldview in which people can only find fulfillment through interacting with other people. Thus is represents a spirit of kinship across both race and creed which united mankind to a common purpose.

Archbishop Emeritus Desmond Tutu has said "Ubuntu is very difficult to render into a Western language…It is to say. 'My humanity is caught up, is inextricably bound up, in what is yours'…" *

* No Future Without Forgiveness: A Personal Overview of South Africa's Truth and Reconciliation Commission , Desmond Tutu, © 2000.

“Ubuntu is a concept in the Bantu Language.
It is about the essence of Humanness.
Simply put: ‘people are people through other people’
I am human because I belong. This concept acknowledges both the rights and the responsibilities of each citizen in promoting individual and societal wellbeing."

Ubuntu means "I am, because you are". In fact, the word ubuntu is just part of the Zulu phrase "Umuntu ngumuntu ngabantu", which literally means that a person is a person through other people. Ubuntu has its roots in humanist African philosophy, where the idea of community is one of the building blocks of society. Ubuntu is that nebulous concept of common humanity, oneness: humanity, you and me both.

The Nguni languages are a group of Bantu languages spoken in southern Africa by the Nguni people.


Sources:

Friday, March 16, 2012

Add 3D tag cloud to blogger


So you want to add this cool gadget to page....
Its easy, just follow me:
Login to your blogger and go to the dashboard OR click the 'More options' little triangle next to the 'Go to post list' button,
Click on 'Overview'
Then on your left hand side-bar click 'Template' and the under your blog thumb you will have 2 options:
Customize & Edit HTML
Click on 'Edit HTML' and Procced...


Remember! this is under your own responsibility!!! so don't mess-up!
Use at your own risk!
I take no responsibility if you mess up your blog!


Remember to always use the 'Preview' option before saving the template.
If anything goes wrong just click 'Close' and when asked 'You have unsaved changes that will be lost.' click OK!


Look for the line that says:
<b:section class='sidebar' id='sidebar' preferred='yes'>
OR the line:
<b:widget id='PageList1' locked='false' title='Pages' type='PageList'/>


And paste the following right after:
Remember! always use the 'Preview' option before saving the template.
Click 'Preview' and see if it apears currectly....


<b:widget id='Label99' locked='false' title='Labels' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<script src='http://sites.google.com/site/bloggerustemplatus/code/swfobject.js' type='text/javascript'/>
<div id='flashcontent'>Blogumulus by <a href='http://www.roytanck.com/'>Roy Tanck</a> and <a href='http://www.bloggerbuster.com'>Amanda Fazani</a></div>
<script type='text/javascript'>
var so = new SWFObject(&quot;http://sites.google.com/site/bloggerustemplatus/code/tagcloud.swf&quot;, &quot;tagcloud&quot;, &quot;240&quot;, &quot;300&quot;, &quot;7&quot;, &quot;#ffffff&quot;);
// uncomment next line to enable transparency
//so.addParam(&quot;wmode&quot;, &quot;transparent&quot;);
so.addVariable(&quot;tcolor&quot;, &quot;0x333333&quot;);
so.addVariable(&quot;mode&quot;, &quot;tags&quot;);
so.addVariable(&quot;distr&quot;, &quot;true&quot;);
so.addVariable(&quot;tspeed&quot;, &quot;100&quot;);
so.addVariable(&quot;tagcloud&quot;, &quot;<tags><b:loop values='data:labels' var='label'><a expr:href='data:label.url' style='12'><data:label.name/></a></b:loop></tags>&quot;);
so.addParam(&quot;allowScriptAccess&quot;, &quot;always&quot;);
so.write(&quot;flashcontent&quot;);
</script>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>


Resources:
http://www.bloggerbuster.com/2008/08/blogumus-flash-animated-label-cloud-for.html
http://forums.digitalpoint.com/showthread.php?t=1899698

1 Great HONDA CB-750 1972 and a terrible shipping company that cost him his life

I was happy...I won a bid on a beautiful HONDA CB-750 FOUR 1972 on eBay.
I have gone through the trouble of buying a motorcycle on eBay for my father's retirement day and this is what I went through with the shipping company: air7seas. 


This is a letter sent by my lawyer Mr. Arie Weiss, Advocate & Notary,
LAW OFFICES AND NOTARIES
7 Shmuel Hanagid St., Yahalom House
94263 Jerusalem, ISRAEL
Tel. + 972-2-623-1215 Fax + 972-2-624-8667

   On Jerusalem, January 16, 2012
To the Better Business Bureau 
1112 South Bascom Avenue
San Jose, CA 95128
USA

Dear Madam or Sir,

Re: Air 7 Seas Transport Logistic
Inc.
I am writing you in the hopes that your intervention will enable my client to recover his losses from Air 7 Seas, who have to date ignored his attempts to work out the issues with them. In browsing some of the mover reviews, I find that their behavior is apparently not unique to my client’s case.


My client, Judah Melamed, purchased a motorcycle on eBay in December, 2010. Air 7 Seas was to ship the bike to Israel via Istanbul, Turkey. The quote for shipping the motorcycle, as provided by Air 7 Seas, was the most favorable, $ 710, although once the bike was delivered to them, they informed Mr. Melamed that the price would be a bit higher. Cargo insurance was provided and paid for, although despite numerous requests, the insurance documentation was never provided, even when a claim needed to be made, as I will explain. 

The eBay seller had the bike crated and delivered to Air 7 Seas. No complaints or comments about the packing crate were made by Air 7 Seas, and they duly shipped the crate, but to Singapore (!) instead of Istanbul.
When the Singapore agent acted to have the bike sent to Israel, the shipper refused unless my client paid for repacking, since the crate arrived in Singapore broken. 

Air 7 Seas seemed to take days for even the most simple communications, failed to provide insurance information or documentation, so that by the time Mr. Melamed was able to establish that no help would be forthcoming from Air 7 Seas and agreed to pay for repacking at his own expense, the storage fees were such that attempting to salvage the bike became prohibitively expensive.


My client’s attempts at communications were met with unpleasantness and threats to have the bike destroyed, At no time did Air 7 make any effort to help resolve the issue, or to have their Singapore agent attempt to mitigate the local storage charges (accepted practice, especially under the circumstances).

Considering the fact that the motorcycle was to have been shipped to Istanbul and that Air 7 was responsible for the bike being mistakenly shipped to Singapore, full restitution of my client’s losses is mandated, not shrugging it off and leaving Mr. Melamed to his own devices. The bike, safely crated, was delivered to the Air 7 warehouse, but arrived in Singapore in a broken crate, yet Air 7 takes no responsibility, and prevents my client from making an insurance claim by failing to provide any insurance documentation, if any was indeed purchased, rather than just charged for.


I attach documentation supporting the facts set out in my letter. If the BBB can put any sort of pressure on Air 7 Seas to satisfy my client’s claims for damages arising from the shipping to the wrong location, failing to have the bike shipped to Israel as they had been contracted to do and failing to provide help or service of any type, failing to insure or at least failing to provide insurance documentation, that help would be deeply appreciated.

Sincerely yours, 

Arie Weiss, Adv.

Cc: Department of Transportation, Consumer Division 1200 New Jersey Ave. SE, Washington, DC 20590 regarding Licence # 004859
Movers.com 827 Ridgewood
Avenue, North Brunswick, NJ 08902 USA
Air7Seas Transport Logistics
Inc., 1815 Houret Ct. Milpitas, CA 95035 USA
----------------------------------------------------------------------------------------------
This is the complaint filled with the Federal Trade Commission (7th Sep. 2011):
I will make this short and as i get all the information together for filling an international law claim, I will send you a copy:
1. I contacted them (27/12/2010) for exporting a bike bought on eBay on 12/15/2010.
2. Initial price proposal was at 710 USD - I agreed to pay as they were the cheapest.
3. Price got to 1000 USD when they had the bike - they had me in their hands, there was nothing I could do but pay, the price included insurance that they highly recommended is necessary.
4. When the bike was delivered to them, it was crate by the seller (which I payed for) and they had no complaints as for the packing.
5. The bike got to Singapore and the crate was broken.
6. They deliberately delayed responses as to accumulate more time that they can charge storage
for.
7. I tried to get the insurance to cover the re-packing as requested by the shipping gate company, but the shipping company failed to respond with insurance coverage details nor assist in reducing financial damage.
8. I tried to get them to help me sort the matter out with the gate company in Singapore but the kept on threatening by disposal of the bike.
9. I wrote the CEO and the VP but they never responded.
10. I had never had such an offensive service, such power manipulators and extorter.
11. Gate company in Singapore asked for 600 USD for re-packing, after I agreed to pay, the asked for additional storage fees. I checked with shipping experts in Israel and they said that usually such fees are not collected and that the insurance is to cover all charges.
12. I never did get to contact the insurance company nor did I get the insurance coverage policy.
13. I never got the service I payed for!

They are abusive and unfair.
Paying all in advance put me in their mercy and they abused it.
No matter how much I asked them to make this right they kept on ignoring my repeated requests and kept on asking for more money and additional charges.


I wish they are dealt properly by law failing to comply with any standard of international trade and commerce laws and customs.

* All is documented and a transcript of all email correspondence is available.

https://www.ftccomplaintassistant.gov/
------------------------------------------------------
Thank you for filing a complaint with the Federal Trade Commission. Based on the information you have given us, we recommend that you take the following steps, if you have not already.
=================================================
=================================================
It has been 2 months and they have failed to answer.
It has been a year and a half and I have yet not recovered my money.
As an outsider to the American nation I would think things are done differently there, a little more honesty and respect.
I think the American public should denunciate such way of conducting business and put such businesses out of business cause they make every one look bad.
Not to mention the awfal complaints and reviews I read on the internet about air7Seas.

The bike is considered a collectors item in Israel and was meant to be a gift to my Father's retirement day!

I will press charges for the full value of the bike and all additional expenses.


Bike crated before delivery to docks in Michigan:

 The bike in Singapore with broken crate
It was meant to ship to Istanbul!

 Pictures of the Bike:
HONDA CB-750 Four 1972






Complaints filled against air7seas:

THIS BUSINESS IS NOT BBB ACCREDITED


Thiefs and Liars




NEVER USE AIR7SEAS NOT AIR7SEAS.com or AIR7SEAS.us Find a reliable company that can do the job as a fair dealer.