Monday, July 30, 2012

Android Contact’s Birthdays In Your Calendar

,
Go to the Google Calendar web interface on your computer (google.com/calendar).
1) Click the settings button in the upper right
2) Click the “Calendars” settings tab
3) In the Other Calendars section click “Browse Interesting Calendars”
4) Click the More tab here
5)  You should see an item labeled “Contacts’ birthdays and events”, click the Subscribe link. (While you’re in here, you might want to poke around.  There may be some other calendars you’re interested in adding in to your own as well, such as holidays and stuff!)

That’s it!  In a couple minutes, all your contact birthdays will show up on the Calendar in your phone.  How cool is that?

Android Tips and Tricks [Part 2]

,

Android 4.1 Jelly Bean


With Google beginning their roll out of a brand new OS, Jelly Bean, it’s time for all Android lovers to start learning the tips and tricks. With the bump from 4.0 to 4.1, the notification bar is enriched with information from Google+ and Foursquare, Voice Search and Google Now are learning from our habits, and Android is now even recognizing the music we listen to. Since we have only had access for not even 24 hours, we’re still learning too, so if you see something we haven’t covered, please leave it down in the comments section below. 
What’s this song: Google has introduced the “What’s this song?” widget, which will most likely put SoundHound and Shazam out of business. Hold your device next to the source of audio and it will then recognize the song and inform you of what you are listening to. How sweet is that?


Google Now Settings: If you will begin to integrate Google Now into your daily life (which most people should), you will want to know how to tune and tweak it to allow for full-on customization. At the bottom of the Google Now display, there is settings menu which will bring an option for “Google Now Settings.” Inside there is the heart of how Google Now operates on your device.
From here, you tell it about which cards are important to you. Do you travel more than most others? Then you’ll want the airline info on the top rather than the Sports card. On the other hand, if you’re a daily commuter, having Google Now learn your commute routine and being on the lookout for a quick alternative route is where this service will shine. There are many things that we are still learning about Google Now, so you can bet we’ll be posting a ton more info on it as we continue to dig.


Camera and Gallery: Google decided to fancy up the camera and gallery application in Jelly Bean. By introducing a new deck-of-cards like view and swipe controls, looking through your past shots and through your lens at the same exact time is now possible. In the picture I have below, on the right side is my previous shot and on the left is what you see through the lens at that moment. It’s definitely a nifty feature.


Hands Free Actions: A neat little trick in Google Now is the ability to simply say, “Google” without having to touch the mic icon. It will take you to Voice Search and from there, a world of information is at your fingertips. It makes for a nice trick to show off to a friend or fellow Android geek.


Two Finger Gestures in Notification Bar: Depending on the action, some notifications can now be expanded with a two-finger slide motion. For example, after having taken a screenshot, you can either have a small thumbnail on the left side or expand it with a swipe down gesture to see a larger thumbnail. This also works for emails and text messages which will truly come in handy for people who live from their notification bar (most Android users do).


Notification Bar Additions: As you may have noticed, the Android team took a lot of time to make sure the notification bar is the place to be. With integration for apps like Google+ and Foursquare, interacting and taking care of business right from there is the new “in.” If you miss a call, you can simply message or call back straight from the pulldown. To “+1″ a photo that you were tagged in on Google+ is now also an option right from the notifications.


I don’t think either Kellen or myself have come out and said how much we love Jelly Bean so far. The Android team has officially blown our minds and they personally told us there is plenty more to come. If you happen across some other tips or tricks for Jelly Bean, let us know in the comments below. We will also update this post if we find other goodies ourselves. Learning about new Android software is always our favorite part of the job. Enjoy the Bean if you’re lucky enough to have it on your device already.

(droid-life)

Android Tips and Tricks [Part 1]

,

1. Quick Contact Search


Quickly search the contacts using the Phone Dial Pad. I always find it bit difficult to scroll through the contacts and then search for a contact. The alternate way is to use the dial pad and type the numbers which  have the letters on it.
Example: You want to search for “John
Open dial pad, type 564 and you will see all contacts which match with letter combination available on keys 564. In this case, it matched with John.
Next select the contact and press the call button.

2. One Touch Direct Dial

Usually the home screens are filled with apps and widgets. The home screen can also be filled with one touch dial shortcuts. You can keep the shortcuts of frequently calling numbers. Next time when you need to call, just tap the shortcut and the call is made.
To add a direct dial, long press on a blank area of the home screen –> select shortcut -> select direct dial. Choose the contact from contacts. If the contact has multiple phone numbers, make sure you select the right phone number.


Alternately, you can use the same approach to add direct message and email shortcuts.

3. Sync Facebook Contacts


I cannot imagine an android phone without the Facebook app. However many do not know that the contacts on your Facebook account can be synced with the phone contacts. You will be surprised to see many of your friends phone numbers on your phone without you asking them. Also, based on the brand of your phone, you will be able to see some extra feature. Like in Xperia you have Time Space.
To sync your Facebook contacts, open the Facebook app, go to settings, scroll to other settings andsync contact. You can select to Sync all or sync with existing contacts.

4. Scroll contacts – Secondary Scroll


Lets say you have about 50 contacts with letter starting ‘J’. You scroll up to letter J in your contacts and then start looking into all 50 contacts to choose one. Did you know that there was a secondary scroll which will show the contacts by filtering with first two letters?  All you have to do is, once you reach the desired letter, swipe your finger to the left and then start scrolling down. ie in the reverse L direction
Example as shown in the picture, first you scroll till ‘J’ and then swipe the finger to left and scroll till ‘JO’. The secondary scroll will filter the contact start with ‘JA’ to ‘JZ’ based on the direction in which you swipe.
Try it out and you will understand it better.

5. Take a Screen Shot

Android has an option to take the screen shot of your phone screen at any point. You can take the screen shot of your home screen or when an app is opened or when a setting screen is opened or even while watching the video.  All the images taken in this page are using the screen capture functionality.
To take a screen shot, simply press the back button and press the center home button. The captured image will be saved into your gallery.


6. Use Voice Recognition

I am not a big fan of using the phone while driving, having said that sometime we will end using the phone while driving. You may need to send a text message or make a phone call. Use the voice activation feature and be a safe driver.
Press the Mic option available next to the Google search bar and speak.
  • Search Google: [search text] - Ex:president of America
  • Send SMS: send text to [recipient] [message] – Ex: send text to John will be at home by 4 pm
  • Send Email: send email to [recipient] [subject] [body] –  Ex: send email to John Doe presentation Send me the ppt by end of day
  • Make a phone call: call [contact] [phone type] - Ex: call John mobile
  • Play Music: listen to [artist/song/album] - Ex: listen to the decemberists
  • Open website: go to [website] – Ex: go to cnn
  • Get Directions: navigate to [location] -  Ex: navigate to KFC
  • View a map: map of [location] – Ex: map of London

7. Open Recently Used Apps


Android has an option  to open recently used apps without having to look for those apps in that huge list.
Simply long press the home button to get the recently used apps pop up window. Select the app which you need. Also you may have an option to open the task manager where you will be able kill the apps/services which are long running.

8. Fast Redial and Quick Message

Ever felt that it would have been nice to quickly redial the last number from the log without having to first select the log entry and then press the call or message option. There is a way.
To call : Swipe the call log entry from left to right
To Message: Swipe the call log entry from right to left.

9. Google Search Quick Launch

You don’t like that Google search bar using the precious space on your home screen but still need an easy way of accessing it. No worries, long press the menu button of your phone and the Google search bar opens up.

10. Hidden Codes

There are some hidden secret codes which shows some interesting options and some useful information about the phone.
Use the dial pad to type in the below codes
*#*#4636#*#* - Shows Phone information, Battery information, Battery history, Usage statistics
*#*#8255#*#* - Show GTalk service monitor
*#*#1111#*#* - Service Mode
*#*#232331#*#* - Bluetooth test
*#*#3264#*#* - RAM version
*#*#0588#*#* - Proximity sensor test
*#*#2664#*#* - Touch screen test
*#*#0842#*#* - Vibration test


(thelunchtalk)

Sunday, July 29, 2012

Learning Java

,



Version 5.0 of the Java 2 Standard Edition SDK is the most important upgrade since Java first appeared a decade ago. With Java 5.0, you'll not only find substantial changes in the platform, but to the language itself-something that developers of Java took five years to complete. The main goal of Java 5.0 is to make it easier for you to develop safe, powerful code, but none of these improvements makes Java any easier to learn, even if you've programmed with Java for years. And that means our bestselling hands-on tutorial takes on even greater significance.

Learning Java is the most widely sought introduction to the programming language that's changed the way we think about computing. Our updated third edition takes an objective, no-nonsense approach to the new features in Java 5.0, some of which are drastically different from the way things were done in any previous versions. The most essential change is the addition of "generics", a feature that allows developers to write, test, and deploy code once, and then reuse the code again and again for different data types. The beauty of generics is that more problems will be caught during development, and Learning Java will show you exactly how it's done.

Java 5.0 also adds more than 1,000 new classes to the Java library. That means 1,000 new things you can do without having to program it in yourself. That's a huge change. With our book's practical examples, you'll come up to speed quickly on this and other new features such as loops and threads. The new edition also includes an introduction to Eclipse, the open source IDE that is growing in popularity.

Learning Java, 3rd Edition addresses all of the important uses of Java, such as web applications, servlets, and XML that are increasingly driving enterprise applications.

DOWNLOAD HERE 

Friday, July 27, 2012

An Android Guide : These Are The Droids You’re Looking For

,


An Android Guide : These Are The Droids You’re Looking For
Matt Smith | English | PDF | 2.02MB



Mirror: Filehost, Letitbit , Rapidgator


Learn everything you want to learn about Android, for free! “These Are The Droids You’re Looking For: An Android Guide”, by author Matt Smith, is the latest free manual from MakeUseOf.com. Outlining the ins and outs of Android, this guide covers basic everything from basic usage to rooting your phone, and is a must-have if you use Google’s smartphone OS.

Android is among the most influential operating systems crafted this century. Along with iOS, it has paved the way for mobile devices that offer an unprecedented level of functionality. Currently Android is the most common mobile operating system — and there’s no sign that its popularity will wane anytime soon.

Already own an Android device? This guide will help you become acquainted with it, and teach you tricks that can make it even better than it already is. Thinking of buying an Android device? This guide can help you with your decision, by showing you what Android can do.

This amazing manual will teach you:

- Android’s history, from 2003 to now
- Find out what Android version you’re running
- Customizing the Android launcher
- Enjoying music and videos on your phone
- Exploring the Android Marketplace
- How and why you should root your phone
- Securing your Android phone



http://www.filehost.ws/23xuxktm3avi
 http://letitbit.net/download/94407.9ce196eade3cb24f165aa690275e/Android.Guide_softarchive.net.pdf.html
http://rapidgator.net/file/24492380/Android.Guide_softarchive.net.pdf.html

Use your USB flash drives with the Nexus 7 [root]

,

Android Central
One of the few negative points with the Nexus 7 for some, is the lack of any sizable on-board storage. Indeed, looking at a couple of the latest big name game titles such as Max Payne or the Amazing Spider Man further compounds the frustration. With games going well in excess of 1GB -- and even approaching 2GB -- there isn't a great deal of room left for music and videos.
Make no mistake, we're not here to discuss the lack of microSD card. It is what it is. But, what we are here to discuss, is a way of using a USB mass storage device such as a flash drive, with your Nexus 7. Hit the break and have a look.
The capability is there, but out of the box you can't make use of it. With root access though, most things are possible. Many long term Android users may already be familiar with an application called Stickmount. To them, we apologize, and say just this. Stickmount works perfectly well with the Nexus 7 and Jelly Bean.
To everyone else who's new to this, we'll walk you through it step by step. First up, besides root you also need to purchase a USB OTG cable. Not sure what that is? It's essentially an adaptor that features a microUSB port that plugs into the device, and a USB socket which you can plug your flash drive into -- or a mouse or keyboard if you so desire. You'll also need some form of file browser, such as ASTRO or Solid Explorer Beta as we'll be using here.
Then, you'll need to head over to the Play Store and download a copy of Stickmount -- download links below. When you fire up Stickmount, you'll be greeted with the screen seen below.
Android Central
The section labelled "mounts" is the key, as this is where you will mount and un-mount your USB drives -- much as you would on a desktop computer. The app will work its magic, and you'll have your files available to you on your tablet.
Android Central
From here you'll need to switch over to your file browsing application of choice. You need to head into the folder labelled as 'sdcard,' and scroll down until you reach a folder within called 'USB storage.' It is within this folder you will find the files and folders contained on your USB drive -- shown here holding a Windows 8 .iso file. I assure you I'm not carrying that on my Nexus 7!
And thats all there really is to it. From there on out just launch the files as you would any stored on the tablet itself. It isn't a particularly elegant solution, but if you have a large collection of music and movies you wish to carry about then it could definitely prove useful.

By Richard Devine

Thursday, July 26, 2012

[Update: Now With yakju] How-To: Download And Update GSM Galaxy Nexus To Android 4.1.1 Manually (Jelly Bean JRO03C)

,
Following yesterday's Jelly Bean AOSP invasion, the HSPA+ Galaxy Nexus is now receiving the release build 4.1.1 (JRO03C) of Jelly Bean. That's indeed great news, but since the rollout is usually staggered, not all phones are allowed to receive it the second it's out there. If you're rooted or have an unlocked bootloader, why not just bypass the line and flash the update manually? I just did, and it took only a few minutes.

Prerequisites

Update 7/11/12 4am PT: we now have yakju!
Here's what you need to have for this method to work (I will update the post if we figure out the links to OTAs for more variants):
  • takju - this is the GSM variant sold directly by Google and given out at I/O 2012. Your device needs to be running either:
    • JRN84D (Android 4.1) or
    • IMM76I (Android 4.0.4)
  • yakju - this is the international unlocked GSM variant.
    • IMM76I (Android 4.0.4)
If you're unsure whether you have takju or yakju, open up /system/build.prop in your favorite file viewer and see what it says there.

End Result

Here's what you will have after the flash: Android 4.1.1 JRO03C.
Note: The update does not wipe your data.
wm_Screenshot_2012-07-10-20-48-54

Download

Note: these downloads are coming directly from Google. They're the official OTAs, not custom ROMs.

Install

Note: First of all, the bad news - if you're not rooted or don't have an unlocked bootloader, you will have to wait for the OTA. There's no way to manually flash update files with full stock, which is definitely a bummer, but unfortunately it's true. The good news is that you won't have to wait long. Or just unlock your bootloader - it's stupid easy.
Rather than provide the installation steps here, I'm going to refer you to this XDA post which contains excellent instructions for every combination of recovery and root status you can think of. Here are some pictures to guide you along the way (using CWM Touch).
wm_IMAG0164 wm_IMAG0165 wm_IMAG0167
Happy flashing and welcome to Jelly Bean!
Thanks, Karl!

How to move almost all Android apps to SD card (no root required)

,
One of the most anticipated additions to Android 2.2 (aka Froyo) was ability to install applications to SD card, because it helps to free internal memory. When internal phone memory gets full, Android users have two problems: 1) users can’t install any more apps and 2) phone starts working slowly. The slow down is caused by the lower speed of write operations to the internal memory (see this post for more information on this topic), but the bottom line is that having low available space in the internal memory is not desirable.
So what should a user do when Android phone is running out of internal memory? Uninstalling rarely used apps is an obvious and easiest solution. Moving apps that support Froyo’s apps2sd feature to SD card is another option. However, for this feature to work developers need to enable this option in their apps and unfortunately many large apps still do not support apps2sd.
It turns out there is a hack that lets you move almost any Android app to SD card, even if the app developer did not enable this option. And the best part: obtaining root is not required for this to work. More about this hack below, but first let’s take look at the limitations of the Android apps2sd feature.

Apps2sd limitations

Apps2sd functionality is a step in the right direction. However, the way it is implemented creates some restrictions which you should know about:
  • When an app is moved to SD card, portion of an app still remains in the internal phone memory. On average, you can expect that application’s footprint in the phone memory will be reduced by a factor of 2. Note that for some apps the move will save less than 50%, e.g. Google Earth size in the internal memory reduces from 20.5 MB to 15MB, Adobe Flash Player 10.1 reduces from 12.4 MB to 8 MB.
  • If you use a widget on your home screen from an app, this app should not be moved to SD card because the widget will stop working.
  • Android OS doesn’t have any batch tools to move all movable apps to SD card at once. You will need to manually move one app at a time by going through the list of installed apps in Settings->Applications->Manage Applications. This means 2 taps per app and can be a tedious process.
  • System apps such as Maps and Youtube cannot be moved to SD card using stock firmware on unrooted phone. On some phones Adobe Flash Player is pre-installed as a system app and also cannot be moved. Providers may also install bloatware as system apps, which also cannot be moved on unrooted phone. However, on a rooted phone system apps can be deleted or moved – see FAQ below.
  • If you re-flash phone’s firmware, some backup applications may not restore your apps to SD card, but will restore them to the phone memory.
Despite these restrictions, moving apps to SD card is a good way to free up internal phone memory and speed up your Android phone.

Moving (almost) all Android apps to SD card

To run commands which will enable Move to SD card button for most installed apps, you need to have adb executable on your computer. Adb stands for Android Debug Bridge and is used for Android software development, but it is a very useful tool to have for any advanced Android user. You do not need to have a rooted phone to run adb commands.
  1. To download the latest version of Android SDK (which includes adb executable), follow instructions from step 2 in the Installing the SDK article from the official Android development site. Note: you do not need to install any other software such as Eclipse for this procedure.
  2. After downloading the archive of the SDK, unzip it to any folder and remember its location (let’s call this folder <sdk>).
  3. If you are installing Android SDK on Windows machine, you also need to install USB driver as described in USB driver for Windows section.
  4. Connect the phone using USB cable and do not enable USB storage mode. Go to Settings -> Applications -> Development and enable USB debugging.
  5. Start terminal window on your computer (on Windows: click Start, type “cmd” and press Enter).
  6. In the terminal window, navigate to folder containing file named “adb” (<sdk>\platform-tools folder) using this command: cd “full-path-to-sdk-platform-tools” (replace “full-path-to-sdk-platform-tools” with an actual path as shown in the screenshot below).
  7. Type the following lines in the terminal window and press Enter after each line:
    • adb devices
      • This checks that the phone is connected and is in the correct mode. You should see one entry in the list of the attached devices. If you get “device not found” error, see Troubleshooting section below.
    • adb shell
      • If you get “cannot find file” error and are using Mac or Linux, instead type: ./adb shell
    • pm set-install-location 2 
      • (If this command doesn’t work try using the “old” command: pm setInstallLocation 2. Thanks to polosco for the tip.)
    • exit
    • Command prompt commands on Windows
      Command prompt commands on Windows
  8. Now on your phone go to Settings->Applications->Manage Applications.
    • If you have Android 2.3 or later, click on USB Storage tab (may be called SD card). This tab shows a list of apps that either can be installed to SD card or are already on SD card. The ones that have checkbox on the right side are already moved to SD card (credit to Michael Scully for the tip).
    • On Android 2.2 and earlier if you don’s see USB Storage or SD Card tab, click on All tab.
    • Android USB storage tab
  9. Press hardware Menu button and select Sort by Size.
  10. Tap on each app that is taking significant amount of space and tap Move to SD card button. Press hardware Back button and repeat.
  11. (optional) To change the default installation location for new apps back to the internal phone memory,  go back to your terminal window and type:
    • pm setInstallLocation 0
  12. (important) Go to Settings -> Applications -> Development and disable USB debugging. Leaving USB debugging enabled makes your phone vulnerable (e.g. lock pattern can be reset).
  13. Enjoy!
Moving Android Adobe Flash player 10.1 to SD card (apps2sd)
Moving Android Adobe Flash player 10.1 to SD card (apps2sd)

Troubleshooting

  • “Device not found” error in step 7. Make sure that the phone is connected and is in the USB debugging mode (step 4). On Windows, this error can also mean the driver is not installed properly. Double check that you followed USB driver for Windows steps. If you still are getting this error, try installing a driver for your manufacturer from this link:  Tether “ADB” Driver Installation for Windows.
  • “Permission denied” error: make sure that you correctly typed commands.

FAQ

  • Q: Does my phone need to be rooted for this hack to work?
    • A: No.
  • Q: Do I need to setup a full development environment (Java, Eclipse) for this to work?
    • A: No.
  • Q: Can I move systems apps such as Maps, Youtube, Adobe Flash Player to SD card?
    • A: On unrooted phone using stock firmware, no.
  • Q: I don’t have time for this hack. How can I check which of my installed apps officially support moving to SD card?
    • Install “App 2 SD” application from Android Market and it will list applications for which developers enabled apps2sd support.
  • Q: Can I move all apps to SD card in one operation?
    • A: Using stock firmware, no. If you know a way to do so, please let me know in the comments.
  • Q: Can I delete bloatware apps installed as “system apps” by the carriers?
    • Yes, but only if you root your device. With a rooted phone you could delete unused system apps, but it gets a bit complicated. Deleting some apps may cause problems with subsequent OS updates, so you should be careful. See this list for Android system apps can be safely removed. Instead of deleting, you can “freeze” unused system apps using Titanium Backup. Freezing an app will remove it from the app drawer and memory and will make sure it is never launched, but it will not free any space in the internal phone storage.
  • Q: Can I move system apps such as Gmail, Google Maps to SD card on a rooted phone?
    • A: Thanks to Dominique Tardif for this tip: “You have first to uninstall any updates to the system apps in question. Second, using a rooted file manager, delete the original apk from /system/app (android keeps the system app apart from the updates, the latter being at /data/apps). Once this is done, reboot and reinstall the app from the market. It will be installed as a user app and as such will be movable to the sd card. As an example, my gmail, facebook, maps etc. are all on my sd card now.”
  • Q: Can I move system apps to SD card if I’m using a custom ROM?
    • A: Yes. The most popular “aftermarket” Android firmware CyanogenMod puts the absolute minimum of the apps in the system folder. CyanogenMod 7 also by default enables the hack described in this post to allow most apps to be movable to SD card. As a result, many Android apps such as Maps, Youtube, Gmail can be moved to SD card on CyanogenMod 7, while they are unmovable to SD in the stock firmware. Note that to install CyanogenMod the phone doesn’t need to be rooted, but bootloader needs to be unlocked.
Source: XDA-developers.

App2SD + Move2SD Enabler

,
The next method if using application App2SD (need root access) inadequate (less internal memory). we will use Move2SD Enabler for each installation .apk can be set automatically in order to move all to the SD memory card (External). So applications that previously could not be transferred to the SD card because it does not yet support the storage to the SD, could be moved even though there are few applications that really make a rule can not be moved (phone only). This method can save the use of internal memory. there is a shortage of this method, if we connect to a PC using USB Storage mode, then the application is moved to SD, can not run (Force Close).




tutorial Totally Move applications to SD card.

1. Root your device first. tutorial how to rooting here.
2. donload move2SD enabler link1
3. extrack move2SD enabler and install.
4. restart the device.
5. open move2sd enabler. tap I've read it > next.
6. will appear like this: select external > apply.

now, when you install applications will be installed on the SD card.



note:
1. what about the applications already installed ?
go to settings > applications > set the application > applications that want to tap on the move.

2. do not move all applications to the SD card, the application should always be running in background, for example launcher, keyboard pro, handcent remains in internal memory.

3. to avoid the force close (use applications that are already on the move to SD card) must wear a high speed SD card, such as SDHC class 4 and above.

Wednesday, July 25, 2012

Android - Shell & Deployment

,

 Android Debugging Bridge - Shell

You can access your Android emulator also via the console. Open a shell, switch to your "android-sdk" installation directory into the folder "tools". Start the shell via the following command "adb shell".

adb shell 
You can also copy a file from and to your device via the following commands.

// Assume the gesture file exists on your Android device
adb pull /sdcard/gestures ~/test
// Now copy it back
adb push ~/test/gesture /sdcard/gestures2 

This will connect you to your device and give you Linux command line access to the underlying file system, e.g. ls, rm, mkdir, etc. The application data is stored in the directory "/data/data/package_of_your_app".
If you have several devices running you can issue commands to one individual device.

# Lists all devices
adb devices
#Result
List of devices attached
emulator-5554 attached
emulator-5555 attached
# Issue a command to a specific device
adb -s emulator-5554 shell 

Uninstall an application via adb

You can uninstall an android application via the shell. Switch the data/app directory (cd /data/app) and simply delete your android application.
You can also uninstall an app via adb with the package name.

adb uninstall <packagename> 

Emulator Console via telnet

Alternatively to adb you can also use telnet to connect to the device. This allows you to simulate certain things, e.g. incoming call, change the network "stability", set your current geocodes, etc. Use "telnet localhost 5554" to connect to your simulated device. To exit the console session, use the command "quit" or "exit".
For example to change the power settings of your phone, to receive an sms and to get an incoming call make the following.

 
# connects to device
telnet localhost 5554
# set the power level
power status full
power status charging
# make a call to the device
gsm call 012041293123
# send a sms to the device
sms send 12345 Will be home soon
# set the geo location
geo fix 48 51 
 

For more information on the emulator console please see Emulator Console manual

* Deployment

Overview

In general there are you restrictions how to deploy an Android application to your device. You can use USB, email yourself the application or use one of the many Android markets to install the application. The following describes the most common ones.

Deployment via Eclipse

Turn on "USB Debugging" on your device in the settings. Select in the settings of your device ApplicationsDevelopment, then enable USB debugging.
You may also need to install the a driver for your mobile phone. Linux and Mac OS usually work out of the box while an Windows OS typically requires
For details please see Developing on a Device . Please note that the Android version you are developing for must be the installed version on your phone.
To select your phone, select the "Run Configurations", select "Manual" selection and select your device.


The Android Run Configuration on the Target Tab, selecting the "Manual" flag.


Show the selection of the real device to deploy on it.


Android application must be signed before they can get installed on an Android device. During development Eclipse signs your application automatically with a debug key.
If you want to install your application without the Eclipse IDE you can right click on it and select Android ToolsExport Signed Application Package.
This wizard allows to use an existing key or to create a new one.
Please note that you need to use the same signature key in Google Play (Google Market) to update your application. If you loose the key you will NOT be able to update your application ever again.
Make sure to backup your key.

Via external sources

Android allow to install applications also directly. Just click on a link which points to an .apk file, e.g. in an email attachment or on a webpage. Android will prompt you if you want to install this application.
This requires a setting on the Android device which allows the installation of non-market application. Typically this setting can be found under the "Security" settings.

Google Play (Market)

Google Play requires a one time fee, currently 25 Dollar. After that the developer can directly upload his application and the required icons, under Google Play Publishing .
Google performs some automatic scanning of applications, but no approval process is in place. All application, which do not contain malware, will be published. Usually a few minutes after upload, the application is available.

(vogella.com)

Tuesday, July 24, 2012

Fragments

,

Fragments Overview

Fragment components allow you to organize your application code so that it is easier to support different sized devices.
Fragments are components with their own lifecycle and their own user interface. They can be defined via layout files or via coding.
Fragments always run in the context of an Activity. If an Activity is stopped its Fragments will also be stopped; if an Activity is destroyed its Fragments will also get destroyed.
If a Fragment component is defined in an XML layout file, the android:name attribute points to the Fragments class.
The base class for Fragments is android.app.Fragment. For special purposes you can also use more special classes, like ListFragment or DialogFragment.
The onCreateView() method is called by Android once the Fragment should create its user interface. Here you can inflate an layout. The onStart() method is called once the Fragment gets visible.
Fragments can be dynamically added and removed from an Activity via Fragment transactions. This will add the action to the history stack of the Activity, i.e. this will allow to revert the Fragment changes in the Activity via the back button.

When to use Fragments

Fragments make it easy to re-use components in different layouts, e.g. you can build single-pane layouts for handsets (phones) and multi-pane layouts for tablets.
This is not limited to tablets; for example you can use Fragments also to support different layout for landscape and portrait orientation. But as tablets offer significantly more space you typically include more views into the layout and Fragments makes that easier.
The typical example is a list of items in an activity. On a tablet you see the details immediately on the same screen on the right hand side if you click on item. On a handset you jump to a new detail screen. The following discussion will assume that you have two Fragments (main and detail) but you can also have more. We will also have one main activity and one detailed activity. On a tablet the main activity contains both Fragments in its layout, on a handheld it only contains the main fragment.
To check for an fragment you can use the FragmentManager.

DetailFragment fragment = (DetailFragment) getFragmentManager().
  findFragmentById(R.id.detail_frag);
if (fragment==null || ! fragment.isInLayout()) {
 // start new Activity
 }
else {
 fragment.update(...);
} 

To create different layouts with Fragments you can:
  • Use one activity, which displays two Fragments for tablets and only one on handsets devices. In this case you would switch the Fragments in the activity whenever necessary. This requires that the fragment is not declared in the layout file as such Fragments cannot be removed during runtime. It also requires an update of the action bar if the action bar status depends on the fragment.
  • Use separate activities to host each fragment on a handset. For example, when the tablet UI uses two Fragments in an activity, use the same activity for handsets, but supply an alternative layout that includes just one fragment. When you need to switch Fragments, start another activity that hosts the other fragment.

The second approach is the most flexible and in general preferable way of using Fragments. In this case the main activity checks if the detail fragment is available in the layout. If the detailed fragment is there, the main activity tells the fragment that is should update itself. If the detail fragment is not available the main activity starts the detailed activity.
It is good practice that Fragments do not manipulate each other. For this purpose a Fragment typically implements an interface to get new data from its host Activity.

# Fragments Tutorial

Overview

The following tutorial demonstrates how to use Fragments. The entry Activity (called MainActivity of our application) will use different layouts for portrait and for landscape mode.
In portrait mode MainActivity will show one Fragment with a list of names. If the user touches an item in the list, a second Activity called DetailActivity will start and show the selected text.
In landscape mode MainActivity will show two Fragments. The first is again the Fragments which shows the list of names. The second Fragment shows the text of the current selected item. This is similar to the portrait mode, but the whole information will be shown on one screen.

Create project

Create a new project de.vogella.android.fragments with an Activity called MainActivity.

Create layouts for portrait mode

Create or change the following layout files in the "res/layout/" folder.
First create the following file called "details.xml". This layout will be used by the DetailFragment.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:id="@+id/detailsText"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginTop="20dip"
        android:text="Large Text"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textSize="30dip" />

</LinearLayout> 

Change the existing main.xml file. This layout will be used by MainActivity in landscape mode and shows two Fragments.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/listFragment"
        android:layout_width="150dip"
        android:layout_height="match_parent"
        android:layout_marginTop="?android:attr/actionBarSize"
        class="de.vogella.android.fragments.ListFragment" ></fragment>

    <fragment
        android:id="@+id/detailFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="de.vogella.android.fragments.DetailFragment" >
        <!-- Preview: layout=@layout/details -->
    </fragment>

</LinearLayout> 

Create Fragment classes

Create now the Fragment classes. Create the ListFragment class.

package de.vogella.android.fragments;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ListFragment extends android.app.ListFragment {
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

 }

 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);
  String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
    "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
    "Linux", "OS/2" };
  ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity(),
    android.R.layout.simple_list_item_1, values);
  setListAdapter(adapter);
 }

 @Override
 public void onListItemClick(ListView l, View v, int position, long id) {
  String item = (String) getListAdapter().getItem(position);
  DetailFragment fragment = (DetailFragment) getFragmentManager()
    .findFragmentById(R.id.detailFragment);
  if (fragment != null && fragment.isInLayout()) {
   fragment.setText(item);
  } else {
   Intent intent = new Intent(getActivity().getApplicationContext(),
     DetailActivity.class);
   intent.putExtra("value", item);
   startActivity(intent);

  }

 }
} 

Create the DetailFragment class.

package de.vogella.android.fragments;

import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class DetailFragment extends Fragment {
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  Log.e("Test", "hello");
 }

 @Override
 public void onActivityCreated(Bundle savedInstanceState) {
  super.onActivityCreated(savedInstanceState);

 }

 @Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container,
   Bundle savedInstanceState) {
  View view = inflater.inflate(R.layout.details, container, false);
  return view;
 }

 public void setText(String item) {
  TextView view = (TextView) getView().findViewById(R.id.detailsText);
  view.setText(item);
 }
} 

Create layouts for landscape mode

We want that Android uses a different main.xml file in portrait model then in landscape mode.
For this reason create the "res/layout-port" folder.
In portrait mode Android will check the "layout-port" folder for fitting layout files. Only if we would not have a main.xml file in "layout-port", Android would check the "layout" folder.
Therefore create the following main.xml layout file in "res/layout-port".

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <fragment
        android:id="@+id/listFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?android:attr/actionBarSize"
        class="de.vogella.android.fragments.ListFragment" />
</LinearLayout> 

Also create the "details_activity_layout.xml" layout file. This layout will be used in the DetailActivity which is only used in portrait mode. Please note that we could have create this file also in the "layout" folder, but as it is only used in portrait mode it is best practise to place it into this folder.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <fragment
        android:id="@+id/detailFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="de.vogella.android.fragments.DetailFragment" />

</LinearLayout> 

Activities

Create a new Activity called DetailActivity with the following class.

package de.vogella.android.fragments;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.widget.TextView;

public class DetailActivity extends Activity {
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  // Need to check if Activity has been switched to landscape mode
  // If yes, finished and go back to the start Activity
  if (getResources().getConfiguration().orientation == 
    Configuration.ORIENTATION_LANDSCAPE) {
   finish();
   return;
  }

  setContentView(R.layout.details_activity_layout);
  Bundle extras = getIntent().getExtras();
  if (extras != null) {
   String s = extras.getString("value");
   TextView view = (TextView) findViewById(R.id.detailsText);
   view.setText(s);
  }
 }
} 

MainActivity will remain unmodified.

package de.vogella.android.fragments;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {
 
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } }

Run

Run your example. If you run the application in portrait mode you should see only one Fragment. Use Ctrl+F11 to switch the orientation. In horizontal mode you should see two Fragments. If you select an item in portrait mode a new Activity should get started with the selected item. In horizontal mode your second Fragment should display the select item.


ActionBar navigation with Fragments

Fragments can also be used in combination with the ActionBar for navigation. For this your main Activity needs to implement a TabListener which is responsible for moving between the tabs.
The ActionBar allows to add tabs to it via the newTab() method. The following code shows such an Activity. It uses two Fragments, called DetailFragment and ImageFragment. At this point you should be able to create these two Fragments yourself.

package de.vogella.android.fragment;

import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.ActionBar.TabListener;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;

public class MainActivity extends Activity {
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  // setup action bar for tabs
  ActionBar actionBar = getActionBar();
  actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
  actionBar.setDisplayShowTitleEnabled(false);

  Tab tab = actionBar
    .newTab()
    .setText("First tab")
    .setTabListener(new MyTabListener<DetailFragment>(this, "artist",
        DetailFragment.class));
  actionBar.addTab(tab);

  tab = actionBar
    .newTab()
    .setText("Second Tab")
    .setTabListener(new MyTabListener<ImageFragment>(this, "album",
        ImageFragment.class));
  actionBar.addTab(tab);

 }

 public static class MyTabListener<T extends Fragment> implements
   TabListener {
  private Fragment mFragment;
  private final Activity mActivity;
  private final String mTag;
  private final Class<T> mClass;

  
/** * Constructor used each time a new tab is created. * * @param activity * The host Activity, used to instantiate the fragment * @param tag * The identifier tag for the fragment * @param clz * The fragment's Class, used to instantiate the fragment */
public MyTabListener(Activity activity, String tag, Class<T> clz) { mActivity = activity; mTag = tag; mClass = clz; } /* The following are each of the ActionBar.TabListener callbacks */ public void onTabSelected(Tab tab, FragmentTransaction ft) { // Check if the fragment is already initialized if (mFragment == null) { // If not, instantiate and add it to the activity mFragment = Fragment.instantiate(mActivity, mClass.getName()); ft.add(android.R.id.content, mFragment, mTag); } else { // If it exists, simply attach it in order to show it ft.setCustomAnimations(android.R.animator.fade_in, R.animator.animationtest); ft.attach(mFragment); } } public void onTabUnselected(Tab tab, FragmentTransaction ft) { if (mFragment != null) { ft.setCustomAnimations(android.R.animator.fade_in, R.animator.test); ft.detach(mFragment); } } public void onTabReselected(Tab tab, FragmentTransaction ft) { } } }

 (vogella.com)

Monday, July 23, 2012

Mobile JavaScript Application Development +CODE [2012]

,
Mobile JavaScript Application Development +CODE [2012]


Mobile javascript Application Development +CODE [2012] | PDF/EPUB | 15Mb


When developing apps for the latest smartphones, you're faced with several vexing questions. How many platforms do you need to accommodate? What level of support do mobile browsers provide? To help you address these and many other key issues, this guide provides a hands-on tour of the most powerful javascript frameworks available today.
You'll build sample apps with jQuery Mobile, Sencha Touch, and PhoneGap to learn the unique advantages and disadvantages of each framework. From there, you can determine which one is best for your project. This book is ideal for web developers familiar with javascript, HTML, and CSS.

-Experience the simplicity of jQuery Mobile for building cross-browser applications
-Learn how Sencha Touch's architecture, widgets, and blazing-fast rendering engine makes it a good choice for enterprise software
-Use PhoneGap to package your web app into a native iOS, Android, or Windows Phone application
-Discover the impact of various HTML5 features on mobile app development
-Pick up javascript productivity tips as you delve into its object orientation, closures, and coding conventions
-Test and debug your app with a collection of tips, tricks, and tools


Mobile JavaScript Application Development +CODE [2012]
http://extabit.com/file/2dvgfzlbipsd3

mirror:
http://letitbit.net/download/03331.02d908616a6889c2eb3eced2dcc6/Mobile_javascript_Application_Development_-_2012.rar.html
 

Android Development Tutorials Copyright © 2011 -- Template created by O Pregador -- Powered by Blogger Templates