Friday, March 22, 2013

Convert String to Bitmap and Bitmap to String

In android, Normally we send and receive data in the form of string.So if we have image in the Bitmap form then we can not send it to server.So here i made a simple function that you need pass bitmap and it will return a string.


       public String BitMapToString(Bitmap bitmap){
            ByteArrayOutputStream ByteStream=new  ByteArrayOutputStream();
            bitmap.compress(Bitmap.CompressFormat.PNG,100, ByteStream);
            byte [] b=ByteStream.toByteArray();
            String temp=Base64.encodeToString(b, Base64.DEFAULT);
            return temp;
      }

Here is the reverse procedure for converting string to bitmap but string should Base64 encoding


      public Bitmap StringToBitMap(String encodedString){
     try{
       byte [] encodeByte=Base64.decode(encodedString,Base64.DEFAULT);
       Bitmap bitmap=BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.length);
       return bitmap;
     }catch(Exception e){
       e.getMessage();
       return null;
     }
      }

Thursday, March 21, 2013

Improve your concentration while developing "Mobile Application"


Hello Friends!

Being software developer is a pain full situation when we want to focus but fail to focus. In most cases we misjudge our ability and caliber. We start criticize our self for what we should responsible. We forget that we are human being and we born to commit mistakes. We born to learn from our mistake. As a mobile application developer, i have gone through the same situation many times. Every time i try to avoid with some set of rules and principles that worked for me. So let share with each among us

Always leave on time
Generally people thinks that working for longer hours will increase your performance at works. But it never does as i feel. Developing a software is not physical work, so you can not work until your mind is not active. Sitting for more hours will drain your brain and stop thinking. It need quality time rather than being sitting for longer hours. So try to leave on time, yes indeed if you need any urgency and have to work for client late then sitting for more hours does not harm. But it should be a fashion. leaving on time will make you more focus because you have to complete task with in the time

Plan one thing at a time
A CPU can execute million of calculation with in milliseconds but nothing is creative. We have a human mind, we have some limitation and some exceptional abilities. Give half an hour in morning for planning. Allocate task to yourself, divide expected time and start working. Do not spend too much time on a particular thing and continue work till the day end. Now observe what you have completed. If you fail to do something than find the reason, but do not switch on panic button.

Take short break
Stand up from chair every two hours. Take some walk for 2 minute, drink water and again start working. It will relax your brain muscles and boost your concentration for coming two hours. Believe it increase my output 20 %. And most importantly it reduce bug from software i made. In break you can talk to your colleague, it will help you to maintain healthy relationship. But do not misuse break. I call this break, break for bugs

Some Guide Lines while creating your own android application.

Hi Friends!

I am observing some regular mistake that make a good application to be in category of crap. From the last 15 days i am observing trend of Play store applications. On basis of all my observation and experience, I suggest you some tips to improve your application quality

we should do some home work which one necessity and universal truth to create one milestone in your career.



1. Avoid to use high quality Image - Using high quality image, limit available memory for your application. When we load image into memory, it take lots of memory and application heap size shrink drastically. And this becomes the main cause of crashing application. This is really bad experience. If your application really required image of high quality then you can scale them according to device heap size and density. Using image of 3000*4000 on 720*1280 resolution does not mean anything.


2. Shows proper Alert
- Showing proper alert, is big boost to make user happy. I download one application which always show "Your connection is not available" either i have connection or my server does not respond with in time (while downloading application data).This make awkward as i was confused. So always keep related message in alert.


3. Release hardware - If you are using hardware like camera, Bluetooth then please release them properly after use is over. Most immense issue is of GPS if you are using GPS then remove update after use is over. Else it will drain user battery.

4. Use combination of Relative Layout and Density Pixel - Density Pixels (dp)  device independent pixel,which provide good design on phone with different densities. Relative Layout align child on relativity, so chances of hampering layout reduces. 

5. Always remember to close connection - Either you open data base or reading data from online URL, make sure you close all connection pointing to source. Close Input stream and data base connection when you read data. This will help you to avoid conflict and save your memory also.

6. Remove unnecessary permissions - Recently, I read review of my application. User raise one issue, why should one's allow to make phone call. I was surprised that my application never need this permission but i forgot to remove it from manifest and it cost me worse review. So never play with user, Take preventing measure and remove all permission that does not required. This is not common issue but sometimes we commit this by mistake. So double check your manifest permission.

And last but not least, if you have commit any mistake. Then do not need worry, upload a updated version of your application so that user will download your update version.

Wednesday, March 20, 2013

Now (Right to Left) support in Android 4.2


Android 4.1 (Jelly Bean) introduced limited support for bidirectional text in TextView and EditText elements, allowing apps to display and edit text in both left-to-right (LTR) and right-to-left (RTL) scripts. Android 4.2 added full native support for RTL layouts, including layout mirroring, allowing you to deliver the same great app experience to all of your users, whether their language uses a script that reads right-to-left or one that reads left-to-right.

If you do nothing, your app will not change — it will continue to appear as it currently does. However, with a few simple changes, your app will be automatically mirrored when the user switches the system language to a right-to-left script (such as Arabic, Hebrew, or Persian). For example, see the following screenshots of the Settings app:





To take advantage of RTL layout mirroring, simply make the following changes to your app:

Declare in your app manifest that your app supports RTL mirroring.
Specifically, add android:supportsRtl="true" to the <application> element in your manifest file.

Change all of your app's "left/right" layout properties to new "start/end" equivalents.
If you are targeting your app to Android 4.2 (the app's targetSdkVersion or minSdkVersion is 17 or higher), then you should use “start” and “end” instead of “left” and “right”. For example, android:paddingLeft should become android:paddingStart.
If you want your app to work with versions earlier than Android 4.2 (the app's targetSdkVersion or minSdkVersion is 16 or less), then you should add “start” and end” in addition to “left” and “right”. For example, you’d use both android:paddingLeft and android:paddingStart.
For more precise control over your app UI in both LTR and RTL mode, Android 4.2 includes the following new APIs to help manage View components:

android:layoutDirection — attribute for setting the direction of a component's layout.
android:textDirection — attribute for setting the direction of a component's text.
android:textAlignment — attribute for setting the alignment of a component's text.
getLayoutDirectionFromLocale() — method for getting the Locale-specified direction
You can even create custom versions of layout, drawables, and other resources for display when a right-to-left script is in use. Simply use the resource qualifier "ldrtl" to tag your resources, meaning “layout direction right-to-left”. To debug and optimize custom right-to-left layouts, HierarchyViewer now lets you see start/end properties, layout direction, text direction, and text alignment for all the Views in the hierarchy.

It's now easy to create beautiful Android apps for all your users, whether they use a right-to-left or left-to-right language. We look forward to seeing some great apps!


Lifestyle Application (Android)

Hello Friends!

"Android Mobile Development"(AMD) is a professional IT solutions company providing Android application development services across a wide range of application categories. The range of applications covered by the company include Android Lifestyle Applications, Multimedia Applications, Communication Applications, Banking Applications Much More!

Android Lifestyle Applications(ALA) have a very concise aim, namely connecting active lifestyle and wellness oriented communities through location base services that make it possible to capture and share information. Such applications they help in extending the mobile user experience by turning the mobile devices into a powerful connector for fitness, sports and healthy lifestyles.

Android based mobile device market is growing at a rapid pace and so is the market for Android Lifestyle Applications. There has been growing interest by mobile carriers and third party developers to extend mobile device capabilities by adding higher-end Android applications like lifestyle applications and more.

The Double-Edged Sword of Mobile Banking Applications

In today's fast-paced world, mobile banking applications have become indispensable tools for managing finances. These apps, available at your fingertips, offer unprecedented convenience and a host of features that simplify our financial lives. However, they also come with potential risks. Let’s explore both the benefits and the drawbacks of using mobile banking apps.

Benefits of Mobile Banking Applications:

  1. Convenience and Accessibility:

    • 24/7 Banking: With mobile banking apps, you can perform transactions, check account balances, and manage finances anytime, anywhere.
    • No Queues: Avoid the hassle of visiting a bank branch. Everything from transferring funds to paying bills can be done in seconds.
  2. Advanced Features:

    • Real-time Notifications: Receive instant updates on your transactions and account activities, helping you stay on top of your finances.
    • Budgeting Tools: Many apps come with integrated tools that help you track your spending, set budgets, and save money.
    • ATM Locators: Easily find the nearest ATM or bank branch with built-in locators.
  3. Enhanced Security:

    • Biometric Authentication: Features like fingerprint scanning and facial recognition add an extra layer of security, making unauthorized access difficult.
    • Fraud Alerts: Get alerts about suspicious activities and unauthorized transactions, allowing for immediate action.
  4. Cost Efficiency:

    • Reduced Fees: Mobile banking often reduces or eliminates the fees associated with traditional banking services.
    • Eco-friendly: Digital statements and transactions reduce the need for paper, contributing to environmental sustainability.
  5. User-Friendly Design:

    • Intuitive Interfaces: Most apps are designed to be user-friendly, making it easy for people of all ages to navigate and use banking services effectively.

Drawbacks of Mobile Banking Applications:

  1. Security Risks:

    • Potential for Hacking: Despite robust security measures, mobile banking apps can be targets for cyberattacks. Hackers may exploit vulnerabilities to access sensitive information.
    • Phishing Scams: Users may be tricked into providing personal information through fraudulent links or messages.
  2. Technical Issues:

    • App Malfunctions: Mobile apps can experience glitches or crashes, potentially leading to issues with transactions or account access.
    • Compatibility Problems: Some apps may not work well on older devices or with certain operating systems, limiting their usability.
  3. Privacy Concerns:

    • Data Collection: Banking apps often collect and store large amounts of personal data, which can be a concern if the app's privacy practices are not transparent.
    • Location Tracking: Features like ATM locators may require access to your location, raising privacy issues.
  4. Dependence on Technology:

    • Battery and Connectivity: Reliance on mobile banking means you need a charged device and a stable internet connection, which can be limiting in certain situations.
    • Loss or Theft of Device: If your phone is lost or stolen, someone could potentially access your banking information, especially if security measures are not robust.
  5. User Error:

    • Mistaken Transactions: Errors like sending money to the wrong account or incorrect bill payments can occur, and resolving these issues can be time-consuming.

Conclusion:

Mobile banking applications offer unparalleled convenience and efficiency, making them a vital part of modern financial management. However, it is crucial to remain aware of the associated risks and take appropriate measures to protect your data and finances. Always use strong, unique passwords, keep your app updated, and be cautious about the permissions you grant and the information you share.

By balancing the benefits and being vigilant about the risks, you can make the most of mobile banking while safeguarding your financial well-being.


Monday, March 18, 2013

Formatting Android Layout XML & JAVA in Eclipse

Sometimes when you are editing Android Layouts in Eclipse, it makes more sense or is more convenient to change the actual xml content. The problem is, a lot of the time the xml is not pretty to look at. Lines of text often run off the screen and it is difficult to tell where one element begins and another ends.



Don't Worry

 Eclipse has some handy auto-formatting tools. Press Ctrl+Shift+F to auto-format the selected file. Or from the menu, click Source->Format.






Now your file will be cleaned up and easier to edit.




If you have text selected, only the selected text will be formatted. If no Text is selected, the entire file will be formatted. And Auto-Format will work on your Java files too.


Mastering Jetpack Compose: Key Methods for Efficient Android UI Development

Jetpack Compose is a modern toolkit for building native Android UI. It simplifies UI development by providing a declarative approach, making...