emulator-5554 disconnected! Cancelling 'info.androidhive.slidingmenu.MainActivity activity launch'!



The problem as I discovered lays in the fact the the project has no appropriate Virtual Device defined for it in the AVD manager.
So the recommended steps in eclipse are:
  1. Go to "Project"-> Properties-> Android.
  2. On the right pane see what line is checked in the Project build target.
    Remember the target platform number that appears in the selected line.
  3. Go to "Windows"-> AVD Manager.
  4. Check the list of existing Android Virtual Devices for a device that matches the Platform and API level that you have set for your project (see step #2 above).
  5. If there is no line that includes an AVD for your platform (as I suspect), add it using the "New" button.
  6. A "Create New Android Virtual Device" window will be opened. set a new device name. in the "Target" selection box choose the right platform for your project.
--- OR ---
  1. Open Android Virtual Device Manager
  2. select the AVD you use for your app.
  3. Press the start button and wait for a new form to show up called (Launch Options).
  4. Check the box "Wipe user data" and hit "Launch" button.
This should work.
--- OR ---
  1. Open Android Virtual Device Manager
  2. Delete the AVD you use for your app.
  3. Create an new AVD.
  4. Start you new AVD.
This should also work.
-- OR --
try this.. go to DDMS perspective-->select Device-->go to Window-->Navigation-->Show view menu-->reset adb.. .
Enjoy your emulator once again!

SMARTER INVENTORY MANAGEMENT SYSTEM PROJECT BY ANDROID

smarter inventory management system project by android
 1.    Introduction

1.1          About the Project
“Smarter Inventory Management System” is a smart phone  based tracking inventory levels, orders, sales and deliveries. It can also be used in the manufacturing industry to create a work order, bill of materials and other production-related documents. Companies use inventory management software to avoid product overstock and outages. It is a tool for organizing inventory data that before was generally stored in hard-copy form or in spreadsheets. It is often associated with and is similar to distribution software, as distributors that can compete with less cash tied up in inventories have a distinct advantage over their competitors.
Smarter Inventory Management System simplifies stocktaking, stock control and inventory management with Android devices. Focusing on versatile, fast and simple operation this inventory app provides custom fields, data import and export, an integrated camera scanner and support for external Bluetooth bar-code scanners.
For better understanding of our project, we have divided the problems into separate modules. The modules involved in this project are:
1.      User
·         Admin Login
·         Dealer Login
·         Vendor Login

2.      Company  Products
·         Add New Products
·         View Products

3.      Dealer Product Request
·         Create  Dealer Products
·         View Dealer Products Request 

4.      Vendors Orders
·         Create  Vendor Shopping List
·         View Order List
MODULE 1: USER
This module have sub module as Admin login, Dealer login and Vendor login.
Admin Login
             Admin login include a username and password to login into the system view and update all the information.
Dealer Login
             Dealer login include a username and password to login into the system view and update all the information.

Vendor Login
             Vendor login include a username and password to login into the system view and update all the information.

MODULE 2: Company Products
            Smarter inventory management system tab contains four sub tabs namely “Add” for adding
Product-Category up to N-Level, “View” for displaying the N-Level tree structure, “Modify” for modifying any node within that N-Level tree structure, “Delete” for deleting any node form N-Level
 Tree structure.
Add
The “Add” tab gives user a facility for adding N-Level Product Category hierarchy.Add contain fields like Item-type, Product Category, Product Subcategory, Remarks.On selection of the relevant Item type gives value into Product Category. For root level Product Category would be “None” otherwise selecting any other Product Category means this Product Category appearing as parent of the particular Product
Subcategory entering by the user.
 View
“View” tab of “smarter inventory management system” at first shows Item-Type. On selection
of relevant Item-Type brings out root category names. User have to check the particular boxes for which N-Level tree structure will be viewed.
Modify
“Modify” tab of “smarter inventory management system” at first shows Item-Type. On selection of relevant Item-Type gives all root Categories of that particular Item-Type. On selection of relevant Category gives Product Subcategories such that where hierarchy starts from that Category and pass through different sub-sub Categories. On selection of a particular Product Subcategory hierarchy gives user a chance to modify any Category and down line all Subcategories.

Delete
“Delete” tab of “smarter inventory management system” at first shows Item-Type. On selection of relevant Item-Type gives all root Categories of that particular Item-Type. On selection of relevant Category gives Product Subcategories such that where hierarchy starts from that Category and pass through different sub-sub Categories. On selection of a particular Product Subcategory hierarchy gives user a chance to delete Subcategory from last level of Category-Subcategory hierarchy.

MODULE 3: Dealer Product Request
            Item Request tab contains four sub tabs namely “Add” for Requesting Items either to Add in the inventory or send from the inventory, “Modify Request” to change requested quantity, “Item Req. Approval” for approval of requested Items. ”Issue Items” for issuing that request. Only after issuing , Items from inventory can increase or reduced from inventory.
Add
“Add” tab leads user to a page where user can select “it’s a general Item requisition” or “requisition against BOM” . Hyper link on “Requisition against BOM” gives user a facility for requesting Items
from inventory against a whole BOM. Here through Item-Type, Category, Product Subcategory user will get corresponding BOMs . Selection of a particular BOM brings some more fields in a same page like W.O. Number, Quantity(No of sets) , Request Date, Requested by, Cost Center. Hyper link on “Item requisition” gives user facility to request Items going through Type, Category & Subcategory.
Modify Request
Before the requisition been approved requested person can change the particular requisition. To modify user will first choose requisition type. For modifying requisition made against BOM user have to go through “Modify Requisition against BOM” hyper link. Users have to select Item-Type, Category, Subcategory for getting corresponding BOMs. Once a particular BOM been select , lists of BOMs appears into the screen. Each list contains Request No, Quantity, Request Date, Requested By. Clicking the Hyper link on “Request No” brings Requested No, Quantity, Date & Requested By in the same. Here user can modify Quantity(No of sets) requested .

Item Req. Approval
“Item Req. Approval” tab for approval of requisition by some authorized persons. Hyper link on “Approval for requisition against BOM” leads to page having lists  of request made against BOM.Hyper link on “Approval for Item requisition ” leads to page having lists of general Item request.Each list containing Request No., Date, Requested By, Cost Center & Status. Hyper link on “Request No” brings the page where approved authority can approve.


Issue Items
“Issue Items” tab for issuing of requisition by some authorized persons. Hyper link on “Issuing for requisition against BOM” leads to page having lists of approved request made against BOM.
Each list containing Request No., BOM No. & Status. Hyper link on “Request No” brings the page where issuing authority can issue.

Stock Verification
“Stock Verification” tab contains three sub tabs namely “Add” for generating a request for Stock Verification, “Approve” for approving that request, “View” for viewing entered data.

Add
“Add” tab leads a screen to the user where user have to select Item-Type & Category for which stock verification request have to generate. Selection of a particular Category bring the required fields like Item-Name, Current Stock, Physical Stock, Variation, Reason & Date for user entry .
Approval
“Approval” tag for approval of stock verification request by authorized persons.
View
“View” tag leads user to a screen where user can view their requested data & its status.
Reports –
“Reports” tab contains two sub tabs namely “General Reports” for getting reports depending upon Item’s Issue, Receipt or both. Another sub tab “Stock Statement” depending upon Stock-Statement during a given period.

General Reports
The “General Reports” tab leads user to the screen where parameters for Report Generation can be set. The parameters can be divided in three groups. First group is related to Items where user have to select one of between Item No or All. In second group user have to select one of between “As On Date” or “From Date - To Date” . In third group user have to select one of among “Issue” , “Receipt” & “Both” .

MODULE 4: Vendors Orders
The Sale:

·         Transactions are entered simply and easily by key entry or bar-code scanner.
·         User-programmable "hot keys" allow for quick selling of popular items.
·         You can command an instant onscreen search by description, manufacturer's number, product group and UPC codes.
·         Single screen transaction integration saves time by eliminating "screen hopping."
·         Layaway and special order items can be created and tracked.
·         Invoices are printed out on blank or pre-printed forms, or on roll receipt.
·         The system supports electronic cash drawers and customer poll display, and provides full bar-code wand and laser reader support.
·         Customers can be retrieved by last name, home or alternate phone number, Company Name, or by customer number
·         Transactions can be suspended or resumed, allowing increased throughput while preventing delays at the checkout
·         Multi-tendering capabilities including foreign currency
·         Paid out and Paid in tracking and reporting
·         Tracks credit notes and the customer it was issued to, and if already redeemed; Reminds cashiers to ask for outstanding Credit Notes when totaling Customer Transaction
·         Sell multiple Gift Certificates on one receipt and combine with regular purchases for one customer transaction; Track if Gift Certificates have been redeemed yet or not
·         Ability to record deposits and track partial of full pickups
·         Reprint or Recall any invoice at a later date
·         Screen displays large, readable characters when totaling
·         Customer survey and special shipping information and functions
·         Single Item Discounting on the fly
·         Multiple Item Discount allows Retailers to further reduce "already reduced items" at the time of sale
·         Returns By Invoice # speeds of multiple item returns from the same invoice #; Smart Vendor retrieves price paid from the past invoice
·         Serial number and warranty information can be entered on invoices
·         Link Extended Warranty Fee items to appropriate stock items to remind sales staff to sell them
·         Link appropriate Electrical & Electronic Equipment fee to stock items to ensure the proper fee is collected at time of sale
·         Link Bottle Deposits to beverage and other items as needed to ensure the proper fee is collected at the time of sale
·         Sell several independent items as a group for a predetermined price (Gift Baskets and similar concepts)
·         Quick and easy on-screen packaging of non-related items
·         Residual Value Gift Card module tracks unused balances on Smart Vendor activated Gift Cards

1.2         Objectives of the Project

Smarter inventory management system App for Android

Use this app for mobile stocktaking and inventory control. Smarter inventory management system provides smooth and easy operation optimized for smart phones and tablets. The support of external Bluetooth scanners outlines this app especially for business and industrial application areas.
 Smarter inventory management system tasks with your Android device!
Create, manage and control your item stock lists, scroll of articles, part lists, equipment serial numbers, physical or fixed assets, CD and DVD collections, etc. The built-in barcode scanner and the integrated support for industry-grade Bluetooth scanners allow you to manage item data in no time at all.
Rapid Inventory was optimized for fast and smooth operation on smart phones and tablets; particular emphasis was placed on simple and intuitive operation. The integrated data exchange functions allow you to import existing stock lists or to use the collected data for further processing. Data import and data export can be performed using CSV files, XML files or by the means of Google Docs (Google online spreadsheets).
Feature Overview:
·         Simple and fast design
The user interface was designed for simple and fast operation. A complete inventory is created in just a few minutes from scratch.
·         Quick stock quantity update
Increment or decrement stock quantities by just one click.
·         Searchable item list
The item list can be displayed by ID or by description. Items are searched automatically for a complete or partial match whenever the user enters text or scans a barcode.
·         Data import and data export
Data import and data export from/to CSV files (e.g. created with Microsoft Excel), XML files and Google Drive spreadsheets is supported.
·         Built-in camera barcode scanner
The built-in camera barcode scanner (by ZXing) reliably decodes most linear and 2D codes.
·         Bluetooth barcode scanner support
Barcodes can be scanned with the integrated camera scanner or with industry-grade external Bluetooth barcode scanners (Bluetooth SPP required) . External scanners are recommended for a better scanning experience and improved efficiency.
·         Optimized for smart phones and tablets
On tablets the app displays the relevant data (item list view and item detail view) on a single screen. On smart phones these views are separated.

Smarter inventory management system for Android: User Manual

Smarter inventory management system is an efficient tool for inventory control, asset management and stock-taking. The app can be used without internet connection, the inventory data is stored locally on the device. The app offers adjustable item database fields and the possibility to use multiple quantity fields. This is especially helpful when managing several stores. Item data can be imported and exported from/to CSV-files, XML-files and Google docs online spreadsheets.
Smarter inventory management system was designed for easy and time-saving operation on smart phones and tables. Barcodes can be scanned immediately with the integrated camera scanner. Additionally, external Bluetooth barcode scanners are supported to improve the scanning experience.
The app displays all items in a searchable item list, the item details can be edited in the detail view. On tablets the item list and the detail view are displayed simultaneously beside each other, on phones the detail view can be opened by tapping on an item. The sort order of the item list is adjustable, in addition the item list can be filtered with the help of item labels.

Adjustable Database Fields

smarter inventory management system supports custom fields. You can remove unwanted fields or add additional ones, the only mandatory field is Barcode / Item-ID.
Open the field editor by selecting Fields in the menu. Tap on a field to edit it or add a new field by tapping the + icon. To delete a field or to change the display order of the fields in the detail view long-tap on a field name in the field list.
In order to apply the field configuration, you need to save it with the Save icon.
Very Important: deleting a field also deletes the corresponding field data in the database!
Choose between the following field types:
  • Boolean
    Displays a check-box to enter a Boolean value.
  • Date
    A date picker for date-only values.
  • Decimal
    An input box for positive or negative decimal values.
  • Quantity
    An input box for positive or negative quantities. A quantity field is displayed along with +1, -1 and +/- n buttons for fast item check in/check out. Rapid Inventory can be used to track the quantities in multiple stores, just add multiple quantity fields if required.
  • Image (low resolution)
    An image field which stores a low-res image taken with the built-in camera.
  • Integer
    An input field for a positive or negative integer value.
  • Text
    A text input field.
  • Selection
    To choose a single value out of a list of values.
  • Time
    A time picker for time-only values.
  • Timestamp
    A picker to enter both date and a time.
  • Description
    A field to enter the description of the item. Only one description field is allowed.
  • Note
    A field to enter a note for the item. Only one note field is allowed.
  • Labels
    A field to tag an item with an arbitrary number of labels. You may filter the item list by labels. Only one label field is allowed.
  • Creation date
    The timestamp (date/time) when the item was created. Only one creation date field is allowed.
  • Modification date
    The timestamp (date/time) when the item was last modified. Only one modification date field is allowed.
  • Origin
    A field holding the device-id (see Settings) on which this entry was created. Only one origin field is allowed.

Add, Edit, Label, Remove

Add

To add an item tap on the Add button, complete the item details and tap the Save button. The field Barcode / Item-ID is mandatory and is automatically populated with the content of the search field. Please note, that the setting Unique Item-IDs controls whether Rapid Inventory enforces unique item-IDs or not.

Edit

To edit an existing item, tap on its entry in the item list and use the detail view to enter the required values. If the the setting Auto Edit is enabled, the item data can be changed immediately. Otherwise you need to activate the edit mode by clicking on the edit-icon. Use the option Auto Close to instruct Rapid Inventory to switch back to the item list immediately after you have saved your changes with Save.

Tag

In Edit-mode you may tag items with custom labels. Make sure a field of type Label is configured with the Fields function (see menu). A single label field can store any number of tags for an item. The item list can be filtered by any combination of labels.

Delete

To delete an item long tap it in the item list or use the Delete button in the detail view.
2. SYSTEM STUDY AND SPECIFICATION

2. SYSTEM STUDY
2.1 Problem Description
The company needs a mobile data collection and inventory management solution that can run on handheld devices. They wish to eliminate uncertainty of stock and location, and have a central database on which to record all of their information (assets, inventories, sales, etc.). There is a need for a large, centralized data repository with a PC interface in order to store, maintain, and process all of the goods, descriptions, quantities, and purchase orders efficiently and collectively.
Inventory management and tracking must be drastically altered. The current system is a WMS export to an Excel spreadsheet that must then be manually transferred back into the WMS system.

2.1.1 Study on Existing System
The PC application must have capabilities to automatically pull handheld data from the device and compile that in the system, once the handheld goes into its charging/sync cradle.
The data from each site must remain separate from the other sites.
The employee should be able to manage desktop information for each inventory item. This implies adding data, analyzing it, or deleting it, to make room for new imports. The data must be easy to sort, filter, and report using an optimized Graphical User Interface (GUI).
The desktop program must be able to maintain separate inventory levels (for each separate room) of the same item.
·         Lack of security of data.
·         More man power.
·         Time consuming.
·         Consumes large volume of pare work.
·         Needs expensive tools to maintain entries.
·         No direct role for the higher officials.

2.1.2 Study on Proposed System
The aim of proposed system is to develop a system of improved facilities. The proposed system can overcome all the limitations of the existing system. The system provides proper security and reduces the manual work.

·         Security of data.
·         Ensure data accuracy’s.
·         Proper control of the higher officials.
·         Minimize manual data entry.
·         Minimum time needed for the various processing.
·         Greater efficiency.
·         Better service.
·         User friendliness and interactive.

2.2 System Specification
2.2.1 Requirement Specification
A. Technical Feasibility
     The system must be evaluated from the technical point of view first. The assessment of this feasibility must be based on an outline design of the system requirement in the terms of input, output, coding and procedures. Having identified an outline system, the investigation must go on to suggest the type of equipment, required method developing the system, of running the system once it has been designed.
Technical issues raised during the investigation are:
Ø    Does the existing technology sufficient for the suggested one?
Ø    Can the system expand if developed?

     The project should be developed such that the necessary functions and performance are achieved within the constraints. The project is developed with latest technology. Through the technology may become obsolete after some period of time, due to the fact that never versions will be same.
But software supports older versions; the system may still be used. So there are minimal constraints involved with this project. The system has been developed using Eclipse the project is technically feasible for future growth.


B. Economic Feasibility
      The developing system must be justified by cost and benefit. Criteria to ensure that effort is concentrated on project, which will give best, return at the earliest. One of the factors, which affect the development of a new system, is the cost it would require.
       The following are some of the important financial questions asked during preliminary investigation:
Ø    The costs conduct a full system investigation.
Ø    The cost of the hardware and software.
Ø    The benefits in the form of reduced costs or higher.
     Since the system is developed as part of project work, there is no manual cost to spend for the proposed system. Also all the resources are already available, it give an indication of the system is economically possible for development.

       C. Behavioral Feasibility
This includes the following questions:
·         Is there sufficient support for the users?
·         Will the proposed system cause harm?
·         Is it flexible and user friendly to user?  
     The project would be beneficial because it satisfies the above objectives when developed and installed. All behavioral aspects are considered carefully and conclude that the project is behaviorally feasible.

2.2.2 System Hardware Specification
·         Intel Core i3 2310 M (Processor).
·         2 GB RAM
·         Hard disk 20 GB
Mobile Hardware Requirement:
·         Mobile Device      :  Android 2.2 versions
·          Camera                 : Back required front camera optional
·         Memory size         : 256 MB
Mobile Software Requirement:
·         Operating System    :   Android 4.4 (kit Kat)
2.2.3 Software Specification
·         Operating System             : Windows 7
·         Internet connect                : Needed
·         Tool: Eclipse                    : 3.6
·         Android SDK                   : 2.2 Version
·         Programming  language   :  XML,JAVA,PHP,MYSQL
·         FRONT END                  :  XML,JAVA
·         Back-End                         :  PHP,MYSQL

2.2.4 Application Specification
ANDROID:
Android, the world's most popular mobile platform
Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It's the largest installed base of any mobile platform and growing fast—every day another million users power up their Android devices for the first time and start looking for apps, games, and other digital content.
Android gives you a world-class platform for creating apps and games for Android users everywhere, as well as an open marketplace for distributing to them instantly.

Global partnerships and large installed base
Building on the contributions of the open-source Linux community and more than 300 hardware, software, and carrier partners, Android has rapidly become the fastest-growing mobile OS.
Android’s openness has made it a favorite for consumers and developers alike, driving strong growth in app consumption. Android users download more than 1.5 billion apps and games from Google Play each month.
With its partners, Android is continuously pushing the boundaries of hardware and software forward to bring new capabilities to users and developers. For developers, Android innovation lets you build powerful, differentiated applications that use the latest mobile technologies.

Powerful development framework
Android gives you everything you need to build best-in-class app experiences. It gives you a single application model that lets you deploy your apps broadly to hundreds of millions of users across a wide range of devices—from phones to tablets and beyond.
Android also gives you tools for creating apps that look great and take advantage of the hardware capabilities available on each device. It automatically adapts your UI to look its best on each device, while giving you as much control as you want over your UI on different device types.
For example, you can create a single app binary that's optimized for both phone and tablet form factors. You declare your UI in lightweight sets of XML resources, one set for parts of the UI that are common to all form factors and other sets for optimizations specific to phones or tablets. At runtime, Android applies the correct resource sets based on its screen size, density, locale, and so on.
To help you develop efficiently, the Android Developer Tools offer a full Java IDE with advanced features for developing, debugging, and packaging Android apps. Using the IDE, you can develop on any available Android device or create virtual devices that emulate any hardware configuration.

Open marketplace for distributing your apps
Google Play is the premier marketplace for selling and distributing Android apps. When you publish an app on Google Play, you reach the huge installed base of Android.
As an open marketplace, Google Play puts you in control of how you sell your products. You can publish whenever you want, as often as you want, and to the customers you want. You can distribute broadly to all markets and devices or focus on specific segments, devices, or ranges of hardware capabilities.
You can monetize in the way that works best for your business—priced or free, with in-app products or subscriptions—for highest engagement and revenues. You also have complete control of the pricing for your apps and in-app products and can set or change prices in any supported currency at any time.
Beyond growing your customer base, Google Play helps you build visibility and engagement across your apps and brand. As your apps rise in popularity, Google Play gives them higher placement in weekly "top" charts and rankings, and for the best apps promotional slots in curate collections.
Preinstalled on hundreds of millions of Android devices around the world, Google Play can be a growth engine for your business.

Hardware support
Android devices can include still/video cameras, touch screens, GPS, accelerometers, gyroscopes, barometers, magnetometers, dedicated gaming controls, proximity and pressure sensors, thermometers, accelerated 2D bit blitz (with hardware orientation, scaling, pixel format conversion) and accelerated 3D graphics.
Java support
While most Android applications are written in Java, there is no Java Virtual Machine in the platform and Java byte code is not executed. Java classes are compiled into Dalvik executables and run on Dalvik, a specialized virtual machine designed specifically for Android and optimized for battery-powered mobile devices with limited memory and CPU. J2ME support can be provided via third-party applications.
 Handset layouts
The platform works for various screen sizes from Smartphone sizes and to tablet size, and can potentially connect to an external screen, e.g. through HDMI, or wirelessly with Mira cast. Portrait and landscape orientations are supported and usually switching between by turning. A 2D graphics library, 3D graphics library based on OpenGL ES 2.0 specifications is used.
  Storage
SQLite, a lightweight relational database, is used for data storage purposes.

 FRONT END:  XML, JAVA
  XML
XML stands for Extensible Markup Language and was defined 1998 by the World Wide Web Consortium (W3C).
An XML document consists of elements, each element has a start tag, content and an end tag. An XML document must have exactly one root element (i.e., one tag which encloses the remaining tags). XML differentiates between capital and non-capital letters.
An XML file must be "well-formed".
A well-formed XML file must apply to the following conditions:
·    An XML document always starts with a prolog (see below for an explanation of what a prolog is)
·    Every opening tag has a closing tag.
·    All tags are completely nested.
An XML file is called valid if it is well-formed and if it is contains a link to an XML schema and is valid according to the schema.
Using XML has the following advantages vs. using a binary or unstructured format:
·    XML is plain text.
·    XML represents data without defining how the data should be displayed.
·    XML can be transformed into other formats via XSL.
·    XML can be easily processed via standard parsers.
·    XML files are hierarchical.

XML Elements

An XML document always starts with a prolog which describes the XML file. This prolog can be minimal, e.g. <?xml version="1.0"?> or can contain other information, e.g. the encoding, e.g. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
A tag which does not enclose any content is know as an "empty tag". For example: <flag/>
Comments in XML are defined as: <! COMMENT>

XML processing in Android

The Java programming language provides several standard libraries for processing XML files. The SAX and the DOM XML parsers are also available on Android.
The SAX and DOM parsers API is on Android the same as in standard Java. SAX and DOM have their limitations, therefore it is not recommended to use them on Android. Therefore this tutorial does not give an example for the usage of this library.
The Java standard provides also the Stax parser. This parser is not part of the Android platform.
Android provides for XML parsing and writing the XmlPullParser class. This parser is not available in standard Java but is similar to the Stax parser.
On Android it is recommended to use the XmlPullParser. It has a relatively simple API compared to SAX and DOM and is fast and requires less memory then the DOM API.

Learn Java for Android Development: Introduction to Java

In this tutorial series, you’ll become familiar with Java, the programming language used to develop Android applications. Our goal is to prepare those already familiar with one programming language, such as PHP or Objective-C, to become comfortable working with the Java programming language and dive into Android app development. In this tutorial, you’ll get a brief introduction to Java fundamentals, including object oriented programming, inheritance and more. If you’re new to Java, or just looking to brush up on the details, then this is the tutorial series for you!

Getting Started

As far as prerequisites go, we’re going to assume you understand how to program (perhaps in PHP, or Visual Basic or C++), but that you are unfamiliar with the specifics of programming in the Java language. We aren’t going to teach you to program; we’re going to provide you with clear examples of commonly used Java language constructs and principles, while pointing out some Android-specific tips and tricks.

What You’ll Need

Technically, you don’t need any tools to complete this tutorial but you will certainly need them to develop Android applications.
To develop Android applications (or any Java applications, for that matter), you need a development environment to write and build applications. Eclipse is a very popular development environment (IDE) for Java and the preferred IDE for Android development. It’s freely available for Windows, Mac, and Linux operating systems.
For complete instructions on how to install Eclipse (including which versions are supported) and the Android SDK, see the Android developer website.

What is Java?

Android applications are developed using the Java language. As of now, that’s really your only option for native applications. Java is a very popular programming language developed by Sun Microsystems (now owned by Oracle). Developed long after C and C++, Java incorporates many of the powerful features of those powerful languages while addressing some of their drawbacks. Still, programming languages are only as powerful as their libraries. These libraries exist to help developers build applications.
Some of the Java’s important core features are:
  • It’s easy to learn and understand
  • It’s designed to be platform-independent and secure, using
    virtual machines
  • It’s object-oriented
Android relies heavily on these Java fundamentals. The Android SDK includes many standard Java libraries (data structure libraries, math libraries, graphics libraries, networking libraries and everything else you could want) as well as special Android libraries that will help you develop awesome Android applications.
Java Secure
Let’s take this bubble idea a bit further. Because Java applications run within the bubble that is a virtual machine, they are isolated from the underlying device hardware. Therefore, a virtual machine can encapsulate, contain, and manage code execution in a safe manner compared to languages that operate in machine code directly. The Android platform takes things a step further. Each Android application runs on the (Linux-based) operating system using a different user account and in its own instance of the Dalvik VM. Android applications are closely monitored by the operating system and shut down if they don’t play nice (e.g. use too much processing power, become unresponsive, waste resources, etc.). Therefore, it’s important to develop applications that are stable and responsive. Applications can communicate with one another using well-defined protocols.
Compiling Your Code
Like many languages, Java is still a compiled language even though it doesn’t compile all the way down to machine code. This means you, the developer, need to compile your Android projects and package them up to deploy onto devices. The Eclipse development environment (used with the Android Development plug-in) makes this pretty painless. In Eclipse, automatic compilation is often turned on by default. This means that every time you save a project file, Eclipse recompiles the changes for your application package. You immediately see compile errors. Eclipse also interprets Java as you type, providing handy code coloring and formatting as well as showing many types of errors as you go. Often, you can click on the error and have Eclipse automatically fix a typo, or add an import statement, or provide a method stub for you, saving lots of typing.
You can still manually compile your code if you so desire. Within Eclipse, you’ll find the Build settings under the project menu. If you have “Build Automatically” turned on, you can still choose the “Clean…” option that will allow you to do full rebuild of all files. If “Build Automatically” is turned off, “Build All” and “Build Project” menu options are enabled. "Build All" means to build all of the projects in the workspace. You can have many projects in an Eclipse workspace.
The build process, for regular Java projects, results in a file with the extension of JAR –Java Archive. Android applications take JAR files and package them for deployment on devices as Android Package files with an extension .apk. These formats not only include your compiled Java code, but also any other resources, such as strings, images, or sound files, that your application requires to run as well as the Application Manifest file, AndroidManifest.xml. The Android Manifest file is a file required by all Android applications, which you use to define configuration details about your app.

2.3 Final Outline of the Proposed System
                        Smarter Inventory Management System stocktaking, stock control and inventory management with Android devices. Focusing on versatile, fast and simple operation this inventory app provides custom fields, data import and export, an integrated camera scanner and support for external Bluetooth bar-code scanners.


3. DESIGN AND DEVELOPMENT PROCESS
3. SYSTEM DESIGN
3.1 Design Notations
            Design is defining a model of the new system and continues by converting this model to new system. This method is used to convert the model of the proposed system into computer specification. Data model are converted to a database and process and flows to user procedures and computer programs. The detailed design starts with three activities: - database design, user design and program design. User procedure design uses those parts of the DFD outside the automation boundary to design user procedures.

3.1.1 Data Flow Diagram
Introduction
Software design sits at the technical kernel of the software engineering process and is applied regardless of the development paradigm and area of application. Design is the first step in the development phase for any engineered product or system. The designer’s goal is to produce a model or representation of an entity that will later be built. Beginning, once system requirement have been specified and analyzed, system design is the first of the three technical activities -design, code and test that is required to build and verify software. 
The importance can be stated with a single word “Quality”. Design is the place where quality is fostered in software development. Design provides us with representations of software that can assess for quality. Design is the only way that we can accurately translate a customer’s view into a finished software product or system. Software design serves as a foundation for all the software engineering steps that follow. Without a strong design we risk building an unstable system – one that will be difficult to test, one whose quality cannot be assessed until the last stage.

Data Flow Diagrams
The development of DFD’S is done in several levels.  Each process in lower level diagrams can be broken down into a more detailed DFD in the next level.  The lop-level diagram is often called context diagram. It consists as data flow diagram is graphical tool used to describe and analyze movement of data through a system.  These are the central tool and the basis from which the other components are developed.  The transformation of data from input to output, through processed, may be described logically and independently of physical components associated with the system.  These are known as the logical data flow diagrams.  The physical data flow diagrams show the actual implements and movement of data between people, departments and workstations. Each component in a DFD is labeled with a descriptive name.  Process is further identified with a number that will be used for identification purpose single process bit, which plays vital role in studying the current system.  The process in the context level diagram is exploded into other process at the first level DFD.
The idea behind the explosion of a process into more process is that understanding at one level of detail is exploded into greater detail at the next level.  This is done until further explosion is necessary and an adequate amount of detail is described for analyst to understand the process. Larry Constantine first developed the DFD as a way of expressing system requirements in a graphical from, this lead to the modular design. 
A DFD is also known as a “bubble Chart” has the purpose of clarifying system requirements and identifying major transformations that will become programs in system design.  So it is the starting point of the design to the lowest level of detail.  A DFD consists of a series of bubbles joined by data flows in the system.

DFD Symbols:
In the DFD, there are four symbols
}  A square defines a source(originator) or destination of system data
}  An arrow identifies data flow.  It is the pipeline through which the information flows
}  A circle or a bubble represents a process that transforms incoming data flow into outgoing data flows.
}  An open rectangle is a data store, data at rest or a temporary repository of data


3.2 DESIGN PROCESS
Design is the first step into the development phase for any engineered product or system. Design is a creative process. A good design is the key to effective system. The term “design” is defined as “the process of applying various techniques and principles for the purpose of defining a process or a system in sufficient detail to permit its physical realization”. It may be defined as a process of applying various techniques and principles for the purpose of defining a device, a process or a system in sufficient detail to permit its physical realization. Software design sits at the technical kernel of the software engineering process and is applied regardless of the development paradigm that is used. The system design develops the architectural detail required to build a system or product. As in the case of any systematic approach, this software too has undergone the best possible design phase fine tuning all efficiency, performance and accuracy levels. The design phase is a transition from a user oriented document to a document to the programmers or database personnel. System design goes through two phases of development: Logical and Physical Design.

3.2.1 Database Design

MySQL

MySQL, the most popular Open Source SQL database management system, is developed, distributed, and supported by Oracle Corporation.
·         MySQL is a database management system.
A database is a structured collection of data. It may be anything from a simple shopping list to a picture gallery or the vast amounts of information in a corporate network. To add, access, and process data stored in a computer database, you need a database management system such as MySQL Server. Since computers are very good at handling large amounts of data, database management systems play a central role in computing, as standalone utilities, or as parts of other applications.
·         MySQL databases are relational.
A relational database stores data in separate tables rather than putting all the data in one big storeroom. The database structures are organized into physical files optimized for speed. The logical model, with objects such as databases, tables, views, rows, and columns, offers a flexible programming environment. You set up rules governing the relationships between different data fields, such as one-to-one, one-to-many, unique, required or optional, and “pointers” between different tables. The database enforces these rules, so that with a well-designed database, your application never sees inconsistent, duplicate, orphan, out-of-date, or missing data.

·         MySQL software is Open Source.
Open Source means that it is possible for anyone to use and modify the software. Anybody can download the MySQL software from the Internet and use it without paying anything. If you wish, you may study the source code and change it to suit your needs. The MySQL software uses the GPL (GNU General Public License) to define what you may and may not do with the software in different situations. If you feel uncomfortable with the GPL or need to embed MySQL code into a commercial application, you can buy a commercially licensed version from us.

·         The MySQL Database Server is very fast, reliable, scalable, and easy to use.
If that is what you are looking for, you should give it a try. MySQL Server can run comfortably on a desktop or laptop, alongside your other applications, web servers, and so on, requiring little or no attention. If you dedicate an entire machine to MySQL, you can adjust the settings to take advantage of all the memory, CPU power, and I/O capacity available. MySQL can also scale up to clusters of machines, networked together.

·         MySQL Server works in client/server or embedded systems.
The MySQL Database Software is a client/server system that consists of a multi-threaded SQL server that supports different backends, several different client programs and libraries, administrative tools, and a wide range of application programming interfaces (APIs).
We also provide MySQL Server as an embedded multi-threaded library that you can link into your application to get a smaller, faster, easier-to-manage standalone product.
·         A large amount of contributed MySQL software is available.
MySQL Server has a practical set of features developed in close cooperation with our users. It is very likely that your favorite application or language supports the MySQL Database Server.
   The official way to pronounce “MySQL” is “My Ess Que Ell” (not “my sequel”), but we do not mind if       you pronounce it as “my sequel” or in some other localized way.

Normalization:
 As the name implies, it denoted putting things in the normal form. The application developer via normalization tries to achieve a sensible organization of data into proper tables and columns and where names can be easily correlated to the data by the user. Normalization eliminates repeating groups at data and thereby avoids data redundancy which proves to be a great burden on the computer resources.
These include:
v  Normalize the data.
v  Choose proper names for the tables and columns.
v  Choose the proper name for the data.

First Normal Form:
The First Normal Form states that the domain of an attribute must include only atomic values and that the value of any attribute in a tuple must be a single value from the domain of that attribute. In other words 1NF disallows “relations within relations” or “relations as attribute values within tuples”. The only attribute values permitted by 1NF are single atomic or indivisible values.
The first step is to put the data into First Normal Form. This can be donor by moving data into separate tables where the data is of similar type in each table. Each table is given a Primary Key or Foreign Key as per requirement of the project. In this we form new relations for each nonatomic attribute or nested relation. This eliminated repeating groups of data. A relation is said to be in first normal form if only if it satisfies the constraints that contain the primary key only.

Second Normal Form:
According to Second Normal Form, For relations where primary key contains multiple attributes, no nonkey attribute should be functionally dependent on a part of the primary key. In this we decompose and setup a new relation for each partial key with its dependent attributes. Make sure to keep a relation with the original primary key and any attributes that are fully functionally dependent on it. This step helps in taking out data that is only dependant on apart of the key.
A relation is said to be in second normal form if and only if it satisfies all the first normal form conditions for the primary key and every non-primary key attributes of the relation is fully dependent on its primary key alone.



Third Normal Form:
According to Third Normal Form, Relation should not have a nonkey attribute functionally determined by another nonkey attribute or by a set of nonkey attributes. That is, there should be no transitive dependency on the primary key.
In this we decompose and set up relation that includes the nonkey attributes that functionally determines other nonkey attributes. This step is taken to get rid of anything that does not depend entirely on the Primary Key. A relation is said to be in third normal form if only if it is in second normal form and more over the non key attributes of the relation should not be depend on other non key attribute.

3.2.2 Input Design
The design of input focuses on controlling the amount of input required, controlling the errors, avoiding delay, avoiding extra steps and keeping the process simple. The input is designed in such a way so that it provides security and ease of use with retaining the privacy. Input Design considered the following things:
o   What data should be given as input?
o   How the data should be arranged or coded?
o   The dialog to guide the operating personnel in providing input.
o   Methods for preparing input validations and steps to follow when error occur.

3.2.3 Output Design
A quality output is one, which meets the requirements of the end user and presents the information clearly. In output design it is determined how the information is to be displaced for immediate need and also the hard copy output. It is the most important and direct source information to the user. Efficient and intelligent output design improves the system’s relationship to help user decision-making.

Designing computer output should proceed in an organized, well thought out manner; the right output must be developed while ensuring that each output element is designed so that people will find the system can use easily and effectively. When analysis design computer output, they should Identify the specific output that is needed to meet the requirements.

§  Select methods for presenting information.
§  Create document, report, or other formats that contain information produced by the system.

3.2 Development Approach
            Crime File Administration System was designed and develop based on the Waterfall Model. This model particularly expresses the interaction between subsequent phases. Testing software is not an activity, which strictly follows the implementation phase. In each of the software development process, we have to compare the results obtained against that which is required. In all phases quality has to be assessed and controlled.



 
4. TESTING AND IMPLEMENTATION
4. System Testing
Testing is vital to the success of the system. Testing is usually carried out to check for the reliability of the system. System testing makes a logical assumption that if all the parts of the system are correct, the goal will be successfully achieved. The aim of testing is to create a bug free, reliable and secure system. Inadequate testing or non-testing leads to error that may not appear until months later.
System testing is a set of activity that can be planned in advance and conducted systematically. It is a critical element of software quality assurance and represents the ultimate review of specification, design and coding.  Software Testing is essential for correcting errors.  Otherwise the program or the project is not said to be complete.

4.1 Testing Methodologies
Testing is a process of executing a program with the interest of finding an error. A good test is one that has high probability of finding the yet undiscovered error. Testing should systematically uncover different classes of errors in a minimum amount of time with a minimum amount of efforts. Two classes of inputs are provided to test the process
1.      A software configuration that includes a software requirement specification, a design specification and source code.
2.      A software configuration that includes a test plan and procedure, any testing tool and test cases and their expected results.
Testing is divided into several distinct operations:

1. Unit Testing
Unit test comprises of a set tests performed by an individual program prior to the integration of the unit into large system. A program unit is usually the smallest free functioning part of the whole system. Module unit testing should be as exhaustive as possible to ensure that each representation handled by each module has been tested. All the units that makeup the system must be tested independently to ensure that they work as required.
During unit testing some errors were raised and all of them were rectified and handled well. The result was quiet satisfactory and it worked well.


2. Integration Testing
Integration testing is a system technique for constructing the program structure while at the same time conducting tests to uncover errors associated with interfacing. The objective is to take unit tested modules and build a program structure that has been dictated by design. Bottom-up integration is the traditional strategy used to integrate the components of a software system into functioning whole. Bottom-up integration consists
of unit test followed by testing of the entire system. A sub-system consists of several modules that communicated with other defined interface.

The system was done the integration testing. All the modules were tested for their compatibility with other modules .They test was almost successful. All the modules coexisted very well, with almost no bugs. All the modules were encapsulated very well so as to not hamper the execution of other modules.

3. Validation Testing
After validation testing, software is completely assembled as a package, interfacing errors that have been uncovered and corrected and the final series of software test; the validation test begins. Steps taken during software design and testing can greatly improve the probability of successful integration in the larger system. System testing is actually a series of different tests whose primary purpose is to fully exercise the compute –based system.

4. Recovery Testing
It is a system that forces the software to fail in a variety of ways and verifies that the recovery is properly performed.
5. Security Testing
It attempts to verify that protection mechanisms built into a system will in fact protect it from improper penetration. The system’s security must of course be tested from in vulnerability form frontal attack.
6. Stress Testing
Stress tools are designed to confront programs with abnormal situations. Stress testing executes a system in a manner that demands resources in abnormal quantity and volume.



7. Black Box Testing
Black box testing is done to find out the following information as shown in below:

1.      Incorrect or missing functions.
2.      Interface errors.
3.      Errors or database access.
4.      Performance error.
5.      Termination error.
The mentioned testing is carried out successfully for this application according to the user’s requirement specification.
8. Test Data Output
After preparing test data, the system under study is tested using the test data. While testing the system using test data, errors are again uncovered and corrected by using above testing and corrections are also noted for future use.

4.2 Quality Assurance
Quality assurance defines the objective of a project and reviews the overall activities so that errors are corrected early in the development process.

Validation Checking
Validation checks are performed on the following fields.

Text Field
The numeric field can contain only the number of characters lesser than or equal to its size. The text fields are alphanumeric in some tables and alphabetic in other tables. Incorrect entry always error message.

 Numeric Field
            The numeric field can contain only numbers from 0 to 9. An entry of any character flashes an error messages. The individual modules are checked for accuracy and what it has to perform. Each module is subjected to test run along
With sample data. The individually tested modules are integrated into a single system. Testing involves executing the real data information is used in the program the existence of any program defect is inferred from the output. The testing should be planned so that all the requirements are individually tested.
            A successfully test is one that gives out the defects for the inappropriate data and produces and output revealing the errors in the system.


4.2.1 Security Technologies & Policies
                     An organization is secure if neither its ability to attain its corporate objectives nor its ability to survive can be adversely affected by an unwanted event. And organization may be secure against some threats, but insecure against other. No organization can be 100% secure, however much planning is undertaken and however much money is spend on counter measures; any organization, or indeed any person, s liable to suffer from unwanted events.
                    Computer security is defined similarly. A computer based system is a combination of many assets recourses (eq. hardware, software, people, data, procedures, data transmission facilities) design to perform some function or to provide some service. A computer system is secure against a particular threat if countermeasure has been taken to reduce an acceptably low level the amount of loss which the threat may be expected to cause over a given period of time. there are three type of loss, which an organization does not want its computer system to suffer.
Levels of Quality Assurance
There are 3 levels of quality assurance:
Testing: In system testing, the common view is to eliminate program errors. This is extremely difficult and time-consuming, since designers cannot prove 100 percent accuracy. A successful test, then, is one that finds errors.

Validation: System validation checks the qualities of the software in both simulate and live environments. First the software goes to alpha testing and then beta testing.

Certification: Certifies that the program or software package is correct and conforms to standards. Certification is actually used after the package passes the tests.
The quality of an information system on its design testing and implementation. The strategy of error tolerance rather than error avoidance is the basis for successful testing and quality assurance.
Quality assurance consists of the auditing and reporting functions of management. The goal of quality assurance is to provide management with the data necessary to be informed about product quality, thereby gaining insight and confide that product quality is meeting its goal. This is an activity that is applied throughout the engineering process.



Software quality assurance encompasses:
·                        Analysis, design, coding, testing methods and tools
·                        Formal technical reviews that are applied during each software engineering
·                        Multi-tiered testing strategy
·                        Control of software documentation and the change made to it


4.3 System Implementation
4.3.1 Implementation Procedures
          After proper testing and validation, the question arises whether the system can be implemented or not. Implementation includes all those activities that take place to convert from old system to new. The new system may be totally new replacing an existing manual or automated system, or it may be a major modification to an existing system. In other case, proper implementation is essential to provide a realiable system to meet requirements.

4.3.2 User Training
The document is the only one that describes the requirements of the system. It is meant for use by the developers and will also be the basis for validating the final delivered system. Any change made to the requirements in designed In such to undergo a formal change approved process. The system is designed in such a way that addition of new modules can be done is very simple and efficient manner.

4.3.3 Operational Documentation
       Documentation means of communication; it establish the design and performance criteria of the project. Documentation is descriptive information that portrays the use and/or operation of the system
§  Documentation tools
                  Document production and desktop publishing tool support nearly ever aspect of software developers. Must software development organizations spend a substantial amount of time developing documents, and in any cases the documentation process itself is quite inefficient. Documentation tools provide an important opportunity to improve productivity.
§  Document restructuring
                 Documentation must be updated, but we have limited resources. It may not be necessary to fully predicaments and application. Rather, those portions of the system that are currently undergoing change are fully documented.

4.4 System Maintenance
Maintenance is a fact of life, in the development of new application systems, however the making of changes and adjustments do not necessarily be considered as corrections of errors or the occurrence of problem. The most frequent changes requested by the end users are the additional information to a report format. Sometimes information requirements may be revised as result of system usage or changing operational needs.
Often the need will arise to capture additional data for storage in a database or in transaction files. Perhaps it will be necessary to add error. Deduction feature to prevent system users from inadvertently taking an unwanted action. The above mentioned are realities of the maintenance.
The new system is well designed and developed with adequate sources for maintenance of the system, in future the system is designed in such a way that any additional reports could be generated fulfils the user’s requirements. In this system, we are provided tool tip to the data, for the correct data entry process are maintenance.


                                              CONCLUSION
Use this app for mobile stocktaking and inventory control. Smarter inventory management system provides smooth and easy operation optimized for smart phones and tablets. The support of external Bluetooth scanners outlines this app especially for business and industrial application areas.


SCOPE FOR FURTHER ENHANCEMENT

In future, the project can include online Smartphone service to make notification to the inventory administrators, dealer and the vendor who want to maintain a good database regarding their Smarter inventory management system and search the details respectively. This possible future enhancement will add more effectiveness to the existing project. Attractive design and standard user interface standards are applied to facilitate the users of the website.

This project can be further enhanced to provide greater flexibility and performance with certain modifications whenever necessary.

                                          BIBLIOGRAPHY

The following books are referred during the analysis and execution phase of the project.
1. Hello, Android Introducing Google's Mobile Development Platform (Book - 2), 3rdEdition 3rd Edition
2 Beginning Android 4 Application Development

     3. Professional Android Application Development (Wrox Programmer to Programmer)[Paperback]

     4. Roger S Pressman, “Software Engineering”,2000 Edition,Dreamtech Publications

     5.  Professional Android 2 Application Development [Paperback]

     6.   Sams Teach Yourself Android Application Development in 24 Hours [Paperback]

     7.  Android Wireless Application Development (2nd Edition) (Developer's Library) [Paperback]

  
Android Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="info.androidhive.slidingmenu"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="18"
android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.INTERNET" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="info.androidhive.slidingmenu.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="info.androidhive.slidingmenu.InfoMainActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.LoginMainActivity" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Aboutas"
android:label="@string/title_activity_aboutas" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Manufactur"
android:label="@string/title_activity_manufactur" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Productsss"
android:label="@string/title_activity_products" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Careers"
android:label="@string/title_activity_careers" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Contact"
android:label="@string/title_activity_contact" >
</activity>
<activity android:name="info.androidhive.slidingmenu.Dealer" >
</activity>
<activity android:name="info.androidhive.slidingmenu.AllitemsMainActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.AddMainActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.companyMainScreenActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.companyEditProductActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.companyAllProductsActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.companyNewProductActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.EditMainActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.Vendorlogin" >
</activity>
<activity android:name="info.androidhive.slidingmenu.prod" >
</activity>
<activity android:name="info.androidhive.slidingmenu.vendorbyers" >
</activity>
<activity android:name="info.androidhive.slidingmenu.vendorsAddMainActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.vendorsAllitemsMainActivity" >
</activity>
<activity android:name="info.androidhive.slidingmenu.vendorsEditMainActivity" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Companylogin"
android:label="@string/title_activity_companylogin" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Vendor"
android:label="@string/title_activity_vendor" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Vendorall_products"
android:label="@string/title_activity_vendorall_products" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Vendoredit"
android:label="@string/title_activity_vendoredit" >
</activity>
<activity
android:name="info.androidhive.slidingmenu.Vendoesadd"
android:label="@string/title_activity_vendoesadd" >
</activity>
</application>

</manifest>

Aboutas.java
package info.androidhive.slidingmenu;

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

public class Aboutas extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_aboutas);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.aboutas, menu);
return true;
}

}


AddMainActivity.java
package info.androidhive.slidingmenu;

import java.util.ArrayList;
import java.util.List;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


public class AddMainActivity extends Activity {

// Progress Dialog
private ProgressDialog pDialog;

JSONParser jsonParser = new JSONParser();
EditText inputcname;
EditText inputdname;
EditText inputpname;
EditText inputmodel;
EditText inputtotal;
private static final int NOTIFY_ME_ID=1337;
String msgg="New Order Received";

// url to create new product
private static String url_create_product = "http://10.0.2.2/android_connect/create_product.php";

// JSON Node names
private static final String TAG_SUCCESS = "success";

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.add_main);

final NotificationManager mgr=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);

Notification note=new Notification(R.drawable.deal,msgg,System.currentTimeMillis());

PendingIntent i = PendingIntent.getActivity(getBaseContext(), 0,
new Intent(getBaseContext(),AllitemsMainActivity.class),0);

note.setLatestEventInfo(getBaseContext(), "dealer products request ","DEALAR", i);


mgr.notify(NOTIFY_ME_ID, note);



// Edit Text
inputcname = (EditText) findViewById(R.id.inputcname);
inputdname = (EditText) findViewById(R.id.inputdname);
inputpname = (EditText) findViewById(R.id.inputpname);
inputmodel = (EditText) findViewById(R.id.inputmodel);
inputtotal = (EditText) findViewById(R.id.inputtotal);

// Create button
Button button1 = (Button) findViewById(R.id.button1);

// button click event
button1 .setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View view) {
// creating new product in background thread
new CreateNewProduct().execute();
}
});
}

/**
* Background Async Task to Create new product
* */
class CreateNewProduct extends AsyncTask<String, String, String> {

/**
* Before starting background thread Show Progress Dialog
* */
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(AddMainActivity.this);
pDialog.setMessage("Creating Product..");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
//                                  pDialog.show();
}

/**
* Creating product
* */
protected String doInBackground(String... args) {
String cname = inputcname.getText().toString();
String dname = inputdname.getText().toString();
String pname = inputpname.getText().toString();
String model = inputmodel.getText().toString();
String total = inputtotal.getText().toString();

// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("cname", cname));
params.add(new BasicNameValuePair("dname", dname));
params.add(new BasicNameValuePair("pname", pname));
params.add(new BasicNameValuePair("model", model));
params.add(new BasicNameValuePair("total", total));
System.out.println("data"+params);
// getting JSON Object
// Note that create product url accepts POST method
JSONObject json = jsonParser.makeHttpRequest(url_create_product,
"POST", params);

// check log cat fro response
Log.d("Create Response", json.toString());

// check for success tag
try {
int success = json.getInt(TAG_SUCCESS);

if (success == 1) {
// successfully created product
Intent i = new Intent(getApplicationContext(), AllitemsMainActivity.class);
startActivity(i);

// closing this screen
finish();
} else {
// failed to create product
}
} catch (JSONException e) {
e.printStackTrace();
System.out.println("error"+e);
}

return null;
}



}
}


AlertDialogManagerlogin
package info.androidhive.slidingmenu;

import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class AlertDialogManagerlogin {
/**
* Function to display simple Alert Dialog
* @param context - application context
* @param title - alert dialog title
* @param message - alert message
* @param status - success/failure (used to set icon)
*               - pass null if you don't want icon
* */
@SuppressWarnings("deprecation")
public void showAlertDialog(Context context, String title, String message,
Boolean status) {
AlertDialog alertDialog = new AlertDialog.Builder(context).create();

// Setting Dialog Title
alertDialog.setTitle(title);

// Setting Dialog Message
alertDialog.setMessage(message);

if(status != null)
// Setting alert dialog icon
alertDialog.setIcon((status) ? R.drawable.success_icon: R.drawable.fail_icon);

// Setting OK Button
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, final int which) {
}
});

// Showing Alert Message
alertDialog.show();
}
}

AllitemsMainActivity.java
package info.androidhive.slidingmenu;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.NameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class AllitemsMainActivity extends ListActivity {

// Progress Dialog
private ProgressDialog pDialog;

// Creating JSON Parser object
JSONParser jParser = new JSONParser();

ArrayList<HashMap<String, String>> productsList;

// url to get all products list
private static String url_all_products = "http://10.0.2.2/android_connect/get_all_products.php";

// JSON Node names
private static final String TAG_SUCCESS = "success";
private static final String TAG_PRODUCTS = "products";
private static final String TAG_PID = "pid";
private static final String TAG_cNAME = "cname";
private static final String TAG_dNAME = "dname";
private static final String TAG_pNAME = "pname";
private static final String TAG_MODEL = "model";
private static final String TAG_TOTAL = "total";

// products JSONArray
JSONArray products = null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_allitems_main);

// Hashmap for ListView
productsList = new ArrayList<HashMap<String, String>>();

// Loading products in Background Thread
new LoadAllProducts().execute();

// Get listview
ListView lv = getListView();

// on seleting single product
// launching Edit Product Screen
lv.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// getting values from selected ListItem
String pid = ((TextView) view.findViewById(R.id.pid)).getText()
.toString();



// Starting new intent
Intent in = new Intent(getApplicationContext(),
EditMainActivity.class);
// sending pid to next activity
in.putExtra(TAG_PID, pid);



// starting new activity and expecting some response back
startActivityForResult(in, 100);
}
});

}

// Response from Edit Product Activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// if result code 100
if (resultCode == 100) {
// if result code 100 is received
// means user edited/deleted product
// reload this screen again
Intent intent = getIntent();
finish();
startActivity(intent);
}

}

/**
* Background Async Task to Load all product by making HTTP Request
* */
class LoadAllProducts extends AsyncTask<String, String, String> {

/**
* Before starting background thread Show Progress Dialog
* */
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(AllitemsMainActivity.this);
pDialog.setMessage("Loading products. Please wait...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}

/**
* getting All products from url
* */
protected String doInBackground(String... args) {
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
// getting JSON string from URL
JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", params);

// Check your log cat for JSON reponse
Log.d("All Products: ", json.toString());

try {
// Checking for SUCCESS TAG
int success = json.getInt(TAG_SUCCESS);

if (success == 1) {
// products found
// Getting Array of Products
products = json.getJSONArray(TAG_PRODUCTS);

// looping through All Products
for (int i = 0; i < products.length(); i++) {
JSONObject c = products.getJSONObject(i);

// Storing each json item in variable
String id = c.getString(TAG_PID);
String cname = c.getString(TAG_cNAME);
String dname = c.getString(TAG_dNAME);
String pname = c.getString(TAG_pNAME);
String models = c.getString(TAG_MODEL);
String totals = c.getString(TAG_TOTAL);

// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();

// adding each child node to HashMap key => value
map.put(TAG_PID, id);
map.put(TAG_cNAME, cname);
map.put(TAG_dNAME, dname);
map.put(TAG_pNAME, pname);
map.put(TAG_MODEL, models);
map.put(TAG_TOTAL, totals);

// adding HashList to ArrayList
productsList.add(map);
}
} else {
// no products found
// Launch Add New product Activity
Intent i = new Intent(getApplicationContext(),

AddMainActivity.class);
// Closing all previous activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
} catch (JSONException e) {
e.printStackTrace();
}

return null;
}

/**
* After completing background task Dismiss the progress dialog
* **/
protected void onPostExecute(String file_url) {
// dismiss the dialog after getting all products
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
public void run() {
/**
* Updating parsed JSON data into ListView
* */
ListAdapter adapter = new SimpleAdapter(
AllitemsMainActivity.this, productsList,
R.layout.listview, new String[] { TAG_PID,
TAG_cNAME,TAG_dNAME,TAG_pNAME,TAG_MODEL,TAG_TOTAL},
new int[] { R.id.pid, R.id.cname,R.id.dname,R.id.pname,R.id.model,R.id.total});
// updating listview
setListAdapter(adapter);
}
});

}

}
}

companyAllProductsActivity.java
package info.androidhive.slidingmenu;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.http.NameValuePair;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class companyAllProductsActivity extends ListActivity {

// Progress Dialog
private ProgressDialog pDialog;

// Creating JSON Parser object
JSONParser jParser = new JSONParser();

ArrayList<HashMap<String, String>> productsList;

// url to get all products list
private static String url_all_products = "http://10.0.2.2/android_connectss/get_all_products.php";

// JSON Node names
private static final String TAG_SUCCESS = "success";
private static final String TAG_PRODUCTS = "products";
private static final String TAG_PID = "pid";
private static final String TAG_NAME = "name";

// products JSONArray
JSONArray products = null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_allitems_main);

// Hashmap for ListView
productsList = new ArrayList<HashMap<String, String>>();

// Loading products in Background Thread
new LoadAllProducts().execute();

// Get listview
ListView lv = getListView();

// on seleting single product
// launching Edit Product Screen
lv.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// getting values from selected ListItem
String pid = ((TextView) view.findViewById(R.id.pid)).getText()
.toString();

// Starting new intent
Intent in = new Intent(getApplicationContext(),
companyEditProductActivity.class);
// sending pid to next activity
in.putExtra(TAG_PID, pid);

// starting new activity and expecting some response back
startActivityForResult(in, 100);
}
});

}

// Response from Edit Product Activity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
// if result code 100
if (resultCode == 100) {
// if result code 100 is received
// means user edited/deleted product
// reload this screen again
Intent intent = getIntent();
finish();
startActivity(intent);
}

}

/**
* Background Async Task to Load all product by making HTTP Request
* */
class LoadAllProducts extends AsyncTask<String, String, String> {

/**
* Before starting background thread Show Progress Dialog
* */
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(companyAllProductsActivity.this);
pDialog.setMessage("Loading products. Please wait...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
}

/**
* getting All products from url
* */
protected String doInBackground(String... args) {
// Building Parameters
List<NameValuePair> params = new ArrayList<NameValuePair>();
// getting JSON string from URL
JSONObject json = jParser.makeHttpRequest(url_all_products, "GET", params);

// Check your log cat for JSON reponse
Log.d("All Products: ", json.toString());

try {
// Checking for SUCCESS TAG
int success = json.getInt(TAG_SUCCESS);

if (success == 1) {
// products found
// Getting Array of Products
products = json.getJSONArray(TAG_PRODUCTS);

// looping through All Products
for (int i = 0; i < products.length(); i++) {
JSONObject c = products.getJSONObject(i);

// Storing each json item in variable
String id = c.getString(TAG_PID);
String name = c.getString(TAG_NAME);

// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();

// adding each child node to HashMap key => value
map.put(TAG_PID, id);
map.put(TAG_NAME, name);

// adding HashList to ArrayList
productsList.add(map);
}
} else {
// no products found
// Launch Add New product Activity
Intent i = new Intent(getApplicationContext(),
companyNewProductActivity.class);
// Closing all previous activities
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
} catch (JSONException e) {
e.printStackTrace();
}

return null;
}

/**
* After completing background task Dismiss the progress dialog
* **/
protected void onPostExecute(String file_url) {
// dismiss the dialog after getting all products
pDialog.dismiss();
// updating UI from Background Thread
runOnUiThread(new Runnable() {
public void run() {
/**
* Updating parsed JSON data into ListView
* */
ListAdapter adapter = new SimpleAdapter(
companyAllProductsActivity.this, productsList,
R.layout.companylist_item, new String[] { TAG_PID,
TAG_NAME}, 
new int[] { R.id.pid, R.id.name });
// updating listview
setListAdapter(adapter);
}
});

}

}
}




 
android megaflow © 2012 | Designed by Cheap TVS, in collaboration with Vegan Breakfast, Royalty Free Images and Live Cricket Score