General

Writing good code – Design patterns group formed

This is how we at TechJini define good code
- Code that fulfills customer requirement. This is the most important of all, no matter how you have coded, what process you have followed if it doesn’t do what is expected of it, its useless. Ofcourse has to be bug free.
- Easily maintainable code. Do not write thinking that you are responsible only for version 1.0. Think ahead, code should be very easy to maintain. Easy maintenance include – easy for new team members to understand, easy to test, easy to change/add features, well documented etc
- Reusable. Code which can be transformed into components and reused.
- Thoroughly tested, test cases should have full (maximum possible) code coverage.
- Future and change ready.

There are several things we can do to ensure that we write ‘good code’, one of the way is to start with good design. Understanding and having ability to correctly utilize OOP concepts and design patterns. To ensure that everyone in our company is a master we have formed and started TechJini Design Patterms study group. We had our first class yesterday which covered introduction of OOP concept and healthy discussion covering real life examples trying to model real life problems. Its clear that everyone has good base and is an expert in analysing and applying OOP concepts, so we expect to have good discussions in future.

Next session is about Abstract Factory Pattern. Looking forward to it.


HTC Magic – android phone in India total let down

UPDATE 18th Aug 2009:

Finally fastboot problem of perfected SPL is taken care of. We were able to flash new ROM on our android. Google Maps, Android Market, Gmail, Quickoffice, youtube etc are available.

We also tested our application Aw’ Shugs, need some tweaking.

Following links were extremely useful.
http://forum.xda-developers.com/showthread.php?t=548218
http://forum.xda-developers.com/showthread.php?p=4335330#post4335330
How to create GoldCard

All credit goes to xda-developers guys.
————————————————————————————
We bought HTC Magic India’s first and only android phone hoping to test our applications but it has been a total let down. Complete waste of money.
- Cannot root it. SAPPHIRE PVT 32A SHIP S-ON H, HBOOT-1.33.0010 (SAPP10000) CPLD-12 which cannot be rooted.
- There is no android market
- There are no applications by default for eg google maps.

All you get is an expensive touch phone with normal features and no useful app.

We called at least 30 dealers before purchasing and none of us any idea what is android market and whether handsets will have it or not. Only response was buy it to find it. I contacted HTC support asking them how to install google maps, they gave me long instructions on how to use android market to install google maps :) Anyway, it took 3-4 emails and then they realized this handset does not have android market with no immediate plans to release it.

If you are planning to buy HTC magic (India) for development, don’t.

Images after upgrade:

Phone after the upgrade | newdevice2.png


Democratic Company – everyone tells how their preformance should be evaluated.

We have these open sessions regularly in our company where everyone talks about why they chose TechJini, what they like here, what should be changed, we share company’s vision, goals and make everyone understand how they are part of it.
Today’s session was to decide ‘appraisal policy’ i.e. on what criteria company should judge performance. Following are the inputs and will form the basis of our policy.

  1. Initiative / pro-activeness – Do I wait for work to be assigned to me? Even after seeing/knowing about a bug do I wait for someone to raise it?
  2. Following deadlines Following deadlines in itself is not a sign of ‘good performance’ that’s what we are ’supposed’ to do anyways but its considered as good performance if you are given something completely new and you ‘learn and deliver’ or you have a completely untrained team or in any other special scenario.
  3. Commitment / ownership – Accepting the bottom line of any work you do. One of the examples given was if I go on a leave I will ensure that none of my project/customers/work is affected, I will do the needful (without someone telling me) to transfer knowledge and if some urgency happens I will be taking out time from my vacation to help the new/replacement team.
  4. Doing more than what was assigned – Have I worked on projects/tasks which were not part of my regular work? Do I also participate in other activities which do not fall in my job description?
  5. Customer Oriented – Do I always think of what is best for the customer? Do I keep in mind which feature, technology, code will help improve performance and will benefit customer in long run? Do I always point out issues before customer does? Do I get nervous and excited with the customer?
  6. Domain Understanding – At the end of the project do I completely understand the domain?
  7. Knowledge sharing – Am I contributing to company’s body of knowledge? Am I taking sessions or writing articles to share my learning? Am I being approached by team members to solve issues?
  8. Acquiring knowledge – Am I learning only enough to finish the task or at the end of project I am capable of becoming a tech lead for similar technologies?
  9. Homework / spoon-feeding – Am I always finishing my homework before asking for help? Do I ask questions the smart way? Do I need spoon-feeding?
  10. Then there are other good to have skills like general behavior with others, influencing/persuading skills, communication

We also had very interesting discussion on what we think is ‘hard work’.


What we like and dislike about TechJini – Joys and pains of working with TechJini (a start up or small company)

Right from the heart, this is what we ‘jinies’ (I just invented that term :) ) have to say about life at TechJini.
So here is what we like and what we would like to change:

  1. Exposure – We get exposed to different kind of work, something we will get to do in 2 years in a big organization we get to do it in first few months only. – Nuwas
  2. Good Learning – With so many new projects and all with different technology there are new challenges and lot to learn almost every day. – Akshi
  3. More responsibility – Our work is not limited to what is assigned and just coding or testing or designing. We do almost everything and very early in our career. – Everyone
  4. Different technologies – Exposure to different technologies and very easy to shift/learn. We get all the help but are also encouraged and showed how to do quick self learning. This acts as a big confidence boost. – Vipindas
  5. Flexible timings – Flexible working hours in true sense. No enforcement of mandatory working hours, can work from home, if I work on holiday I am given a compensatory off or cash – Everyone
  6. Friendly environment - Very very friendly environment, there are no bosses (absolutely no hierarchy), feels like a small family, even policies are made after open discussions – Everyone
  7. Technical Challenges – We get to face more technical challenges which is making us better programmers. – Everyone
  8. Neelima – Very friendly and helpful person, someone we will not have anywhere else – Sapna
  9. No bureaucracy or politics – Cant be more democratic and fair then in TechJini – Everyone
  10. Open to do whatever I want – I get enough opportunity, time and space to do whatever I want other than my regular work. I was able to finish a certification (which company is happy to pay for) and I can interact with everyone in the company – Arun
  11. No bench – We have never seen anyone without work. There is absolutely no bench and so many product ideas to work on.
  12. My product – Only place where I am encouraged and given full opportunity to work on my own idea and the best part is I don’t have to work alone, everyone in the company will work on my idea.
  13. Formal corporate culture – Culture here is too relaxed, we are serious in what we do but we do not get to see a very formal corporate culture which also has lot to teach.
  14. Brand Name – All the benefits of working for a big brand name.
  15. Company conveyance – hmm…. :)
  16. 6 days a week – Sometimes it pinches that our friends are having fun but we work on Saturdays too. Even though we do not do regular work (extra learning or activities) but still.
  17. Good Office building – We need to move to an attractive address soon, guys are finding it difficult to call prospective in-laws ;)
  18. Website – NEED to change website.

Update:
- Website changed :)

1 Comment more...

Android tip #1 ContentProvider , Accessing local file system from WebView / showing image in webview using content://

ok, this was a tough one.
First be informed that this is something Google (Android people) are trying to prevent i.e. letting browser (WebView) have access to the local file system. In earlier releases of SDK you could access local files using ‘file://’ but it is stopped now. Then there was an option where you can provide a WebViewClient and implement shouldOverrideUrlLoading to make it work. This was also removed.
The way to make it work now is by implementing your own ContentProvider, there is lot of discussion and documentation on implementing ContentProvider but all that is completely redundant (not needed). The solution is very simple, create your own ContentProvider and only override

public android.os.ParcelFileDescriptor openFile(android.net.Uri uri, java.lang.String mode) throws java.io.FileNotFoundException

Rest of the code in ContentProvder is not needed for this problem.

Step 1:
Declare your Content Provider in AndroidManifest.xml

<provider android:name="MyDataContentProvider"  android:authorities="com.techjini" />

Step 2:
Create your ContentProvider and implement openFile
All you have to do is get real path from uri, open it and return the descriptor

URI uri = URI.create("file:///data/data/com.techjini/files/myImage.jpeg");
File file = new File(uri);
ParcelFileDescriptor parcel = ParcelFileDescriptor.open(file, ParcelFileDescriptor.MODE_READ_ONLY);
return parcel;

Step 3:
(You need this step only if file is not already present on the device/sdcard)
Save your content to the file. Following is an example to store a Bitmap

FileOutputStream fos = openFileOutput("myImage.jpeg", Activity.MODE_WORLD_WRITEABLE);
imageView.getBitmap().compress(Bitmap.CompressFormat.JPEG, 100, fos);

fos.flush();
fos.close();

You can find out where your image is stored using

System.out.println(getFilesDir().getAbsolutePath());

Step 4:
Access the file in WebView

myWebView.loadUrl("content://com.techjini/myImage.jpeg");
//com.techjini is what you mentioned in 'android:authorities' in your AndroidManifest.xml

Looks simple :)


JBoss tip #5 Keeping the project in exploded .war file in some other location other than deploy folder

This is how you can increase your productivity while developing an app on Jboss, no need to package and deploy again and again, reduced development and testing time.

Open %JBOS_HOME%\server\default\conf\jboss-service.xml and add the new location

    <attribute name="URLs">
        deploy/, E:/ file:/var/opt/apps/
     </attribute>
1 Comment more...

JBoss tip #4 Increasing the jta time out from default 5 mins to more

Open %JBOSS-HOME%\server\default\conf\jboss-service.xml


name="jboss:service=TransactionManager">
3600
${jboss.server.data.dir}/tx-object-store

[/sourcecode language='css']

3600
[/sourcecode language='css'] by default it would be 300, here we changed it to 3600 which is 1 hr.


JBoss tip #3 Accessing the application out side the local machine

Open %JBOSS_HOME%\server\default\deploy\jboss-web.deployer\server.xml and change the address to “0.0.0.0″

     <Connector port="8081" address="0.0.0.0" maxThreads="250" maxHttpHeaderSize="8192"
        emptySessionPath="true" protocol="HTTP/1.1"
        enableLookups="false" redirectPort="8443" acceptCount="100"
        connectionTimeout="20000" disableUploadTimeout="true" />

Jboss tip #2 Changing the default port number 8080 to some other port

Open %JBOSS_HOME%\server\default\deploy\jboss-web.deployer\server.xml and change the port as per your requirement.

<Connector port="8081" address="0.0.0.0" maxThreads="250" maxHttpHeaderSize="8192"
        emptySessionPath="true" protocol="HTTP/1.1"
        enableLookups="false" redirectPort="8443" acceptCount="100"
        connectionTimeout="20000" disableUploadTimeout="true" />

Jboss tip #1 Connection Pooling And DataSource creation

Which ever data source you create (for instance lets say for oracle data source or mysql data source ) file name should end with “name-ds.xml” and the content should be

<?xml version="1.0" encoding="UTF-8"?>

   <datasources>
         <local-tx-datasource>
           <jndi-name>tjOracleDS</jndi-name>
            <use-java-context>false</use-java-context>
                   <connection-url>jdbc:oracle:thin:@localhost:1521:tjdb</connection-url>
                   <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                     <user-name>staging</user-name>
                   <password>staging</password>
                    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
                        <min-pool-size>5</min-pool-size>
                   <max-pool-size>30</max-pool-size>
                   <blocking-timeout-millis>5000</blocking-timeout-millis>

                 <metadata>
                    <type-mapping>Oracle9i</type-mapping>
                 </metadata>
         </local-tx-datasource>

       </datasources>
<use-java-context>false</use-java-context>   

This help us to remove java:comp from jndi look up for data source


© Copyright 2009 TechJini Solutions Private Limited. All Rights Reserved
iDream theme by Templates Next | Powered by WordPress