2014년 8월 27일 수요일

How to check the package name of current launcher


Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
ResolveInfo resolveInfo = getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);
String packageName = resolveInfo.activityInfo.packageName;

2014년 8월 3일 일요일

How to take a snapshot in Google Map v2

// Once everything has loaded, cache the map’s image for fast display later
// Note: the map loaded callback is only called once.
mMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
    public void onMapLoaded() {
        mMap.snapshot(new GoogleMap.SnapshotReadyCallback() {
            public void onSnapshotReady(Bitmap bitmap) {
                // Write image to disk
            }
        });
    }
});
Reference: http://googlegeodevelopers.blogspot.sg/2013/10/ghost-markers-in-your-neighborhood-new.html

How to change text color of SearchView

int textViewId = mSearchView.getContext().getResources().getIdentifier("android:id/search_src_text", null, null);
TextView textView = (TextView) mSearchView.findViewById(textViewId);
textView.setTextColor(Color.GRAY);

2014년 7월 13일 일요일

Useful Android Intents

Useful Android Intent List

1. Google Maps - get directions between two points
Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=0,0&daddr=10,10"));
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setComponent(new ComponentName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity"));
startActivity(intent);

2. Google Maps - show map
Uri uri = Uri.parse("geo:11.899533,-77.036476");
Intent it = new Intent(Intent.Action_VIEW, uri);
startActivity(it);
3. Call
Uri uri = Uri.parse("tel:xxxxxx");
Intent it = new Intent(Intent.ACTION_DIAL, uri);  
startActivity(it); 
OR
with permission 

Uri uri = Uri.parse("tel.xxxxxx");
Intent it = new Intent(Intent.ACTION_CALL,uri);
4. SMS/MMS
Uri uri = Uri.parse("smsto:0800000123");   
Intent it = new Intent(Intent.ACTION_SENDTO, uri);   
it.putExtra("sms_body", "The SMS text");   
startActivity(it); 

Uri uri = Uri.parse("content://media/external/images/media/23");   
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra("sms_body", "some text");   
it.putExtra(Intent.EXTRA_STREAM, uri);   
it.setType("image/png");   
startActivity(it);
5. Email
Uri uri = Uri.parse("mailto:xxx@abc.com");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
startActivity(it);


Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");   
it.putExtra(Intent.EXTRA_TEXT, "The email body text");   
it.setType("text/plain");   
startActivity(Intent.createChooser(it, "Choose Email Client")); 


Intent it = new Intent(Intent.ACTION_SEND);     
String[] tos = {"me@abc.com"};     
String[] ccs = {"you@abc.com"};     
it.putExtra(Intent.EXTRA_EMAIL, tos);     
it.putExtra(Intent.EXTRA_CC, ccs);     
it.putExtra(Intent.EXTRA_TEXT, "The email body text");     
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");     
it.setType("message/rfc822");     
startActivity(Intent.createChooser(it, "Choose Email Client"));  


// Adding extra
Intent it = new Intent(Intent.ACTION_SEND);   
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");   
it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");   
sendIntent.setType("audio/mp3");   
startActivity(Intent.createChooser(it, "Choose Email Client"));
6. Play Music
Intent it = new Intent(Intent.ACTION_VIEW);
Uri uri = Uri.parse("file:///sdcard/song.mp3");
it.setDataAndType(uri, "audio/mp3");
startActivity(it);


Uri uri = Uri.withAppendedPath(
MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");   
Intent it = new Intent(Intent.ACTION_VIEW, uri);   
startActivity(it); 
7. Uninstall apk
Uri uri = Uri.fromParts("package", PackageName, null);   
Intent it = new Intent(Intent.ACTION_DELETE, uri);   
startActivity(it);
8. Search application in Google Play Store
Uri uri = Uri.parse("market://search?q=pname:pkg_name");  
Intent it = new Intent(Intent.ACTION_VIEW, uri);  
startActivity(it);  
9. Google Search
Intent intent = new Intent();
intent.setAction(Intent.ACTION_WEB_SEARCH);
intent.putExtra(SearchManager.QUERY,"searchString")
startActivity(intent);

2014년 7월 8일 화요일

5. Project Scope Management (2)

5.2 Collect Requirements
Collect Requirements is the process of determining, documenting, and managing stakeholder needs and requirements to meet project objectives.


The project success directly influenced by active stakeholder involvement in the discovery and decomposition of needs into requirements and by the care taken in determining, documenting, and managing the requirements of the product, service or results of the project. Requirements include conditions or capabilities that are to be met by the project or present in the product, service or result to satisfy an agreement or other formally imposed specification. Requirements become the foundation of the WBS, cost, schedule, quality planning and sometimes procurement are all based upon these requirements. The development of requirements begins with an analysis of the information contained in the project charter, the stakeholder register and stakeholder management plan.

Inputs
1) Scope management plan: provides clarity as to how project teams will determine which type of requirements need to be collected for the project.

2)Requirements management plan: provides the processes that will be used throughout the Collect Requirement process to define and document the stakeholder needs.

3)Stakeholder management plan: used to understand stakeholder communication requirements and the level of stakeholder engagement in order to assess and adapt to the level of stakeholder participation in requirement activities.

4) Project charter: used to provide the high level description of the product, service, or result of the project so that detailed requirements can be developed.

Tools & Techniques
1) Interview: Talking to stakeholders directly, typically performed by asking prepared and spontaneous questions and recording the responses.

2) Focus groups: trained moderator guides the group through an interactive discussion, designed to be more conversational than a one-to-one interview.

3) Facilitated workshop: focused sessions that bring key stakeholders together to define product requirements. Workshops are considered a primary technique for quickly defining cross-functional requirements and reconciling stakeholder differences. Because of their interactive group nature, well facilitated sessions can build trust, foster relationships, and improve communication among the participants, which can lead to increased stakeholder consensus. In addition issues can be discovered earlier and resolved more quickly than in individual sessions.

Joint application development (JAD)

  • used in software development industry
  • focus on bringing business subject matter experts and the development team together to improve software development process
Quality function deployment (QFD)
  • helps determine critical characteristics for new product development
  • starts by collection customer needs, also known as Voice of the Customer (VoC)
  • collected needs are then objectively sorted and prioritized
4) Group creativity techniques: group activities can be organized to identify project and product requirements.

  • Brainstorming - used to generate and collect multiple ideas, not include voting or prioritization.
  • Nominal group technique - enhances brainstorming with a voting process used to rank most useful ideas
  • Idea/mind mapping - ideas created through brainstorming are consolidated in a single map to reflect commonality and differences
  • Affinity diagram - large numbers of ideas to be classified into groups for review and analysis
  • Multicriteria decision analysis - utilizes a decision matrix to provide a systematic analytical approach for establishing criteria, such as risk levels, uncertainty, and valuation, to evaluate and rank many ideas


5) Group decision making techniques: can be used to generate, classify and prioritize product requirements

  • Unanimity - everyone agrees on a single course of action, one way to reach unanimity is the Delphi technique.
  • Majority - more than 50%
  • Plurality - largest block in a group decides, even if a majority is not achieved
  • Dictatorship - one individual makes the decision

The experts answer questionnaires in two or more rounds. After each round, a facilitator provides an anonymous summary of the experts’ forecasts from the previous round as well as the reasons they provided for their judgments. Thus, experts are encouraged to revise their earlier answers in light of the replies of other members of their panel. It is believed that during this process the range of the answers will decrease and the group will converge towards the "correct" answer. Finally, the process is stopped after a pre-defined stop criterion.
(keywords: experts, questionnaire, anonymous

6) Questionnaires and surveys: written set of questions designed to quickly accumulate information from large number of respondents, appropriate with varied audiences, when respondents are geographically dispersed and where statistical analysis is appropriate.

8) Prototypes: obtains early feedback on requirements by providing a working model of the expected product before actually building it. allows stakeholders to experiment with a model of the final product rather than being limited to discussing abstract representations of their requirements.


Outputs
1) Requirements documentation: describes how individual requirements meet the business need for the project. Requirements may start out at a high level and become progressively more detailed as more about the requirements is known.

2) Requirements traceability matrix: a grid that links product requirements from their origin to the deliverables that satisfy them. The implementation of a requirements traceability matrix helps ensure that each requirement adds business value by linking it to the business and project objectives. It provides a meas to track requirements throughout the project life cycle, helping to ensure that requirements approved in the requirements documentation are delivered at the end of the project. Finally it provides a structure for managing changes to the product scope.

Tracing includes Business needs, goals, objectives, project scope/WBS deliverables, etc.



2014년 7월 7일 월요일

5. Project Scope Management (1)

Project Scope management includes the processes required to ensure that the project includes all the work required, and only the work required, to complete the project successfully. Managing the project scope is primarily concerned with defining and controlling what is and is not included in the project.

In the project context, the term scope can refer to:
  • Product scope: the features and functions that characterize a product, service or result
  • Project scope: the work performed to deliver a product, service, or result with the specified features and functions. The term project scope is sometimes viewed as including product scope.
The scope baseline for the project is the approved version of the project scope statement, work breakdown structure (WBS), and its associated WBS dictionary. A baseline can be changed only through formal change control procedures and is used as a basis for comparison while performing Validate Scope and Control Scope processes as well as other controlling processes.

Completion of the project scope is measured against the Project management plan. Completion of the product scope is measured against the product requirements. The project scope management processes need to be well integrated with the other knowledge area processes, so that the work of the project will result in delivery of the specified product scope.

5.1 Plan Scope Management
Plan Scope Management is the process of creating a scope management plan that documents how the project scope will be defined, validated, and controlled.


The scope management plan is a component of the project or program management plan that describes how the scope will be defined, developed, monitored, controlled, and verified. The development of the scope management plan and the detailing of the project scope begin with the analysis of information contained in the project charter, the latest approved subsidiary plans of the project management plan, historical information contained in the organizational process assets, and any other relevant enterprise environment factors. This plan helps reduce the risk of project scope creep.


Inputs
1) Project management plan
Approved subsidiary plans of the project management plan are used to create the scope management plan and influence the approach taken for planning scope and managing project scope.

2) Project charter
Project charter is used to provide the project context needed to plan the scope management processes. It provides the high level project description and product characteristics from the project statement of work.

Outputs
1) Scope management plan
Scope management plan describes how the scope will be defined, developed, monitored, controlled and verified. Major input into the Develop Project Management Plan process, and the other scope management processes.

2) Requirements management plan
Requirement management plan is a component of the project management plan that describes how requirements will be analyzed, documented, and managed. 



2014년 7월 4일 금요일

4. Project Integration Management (6)

4.6 Close Project or Phase
Close Project or Phase is the process of finalizing all activities across all of the Project management process groups to formally complete the project or phase.


When closing the project, Project Manager reviews all prior information from the previous phase closures to ensure that all project work is completed and that the project has met its objectives. Since project scope is measured against the project management plan, the project manager reviews the scope baseline to ensure completion before considering the project closed. Close Project or Phase process also establishes the procedures to investigate and document the reason for actions taken if a project is terminated before completion. In order to successfully achieve this, the project manager needs to engage all the proper stakeholders in the process.

Inputs
1) Project management plan: agreement between the project manager and project sponsor, defining what constitutes project completion

2) Accepted deliverables: include approved product specifications, delivery receipts and work performance documents, Partial or interim deliverables may also be included for phased or cancelled projects.

3) Organizational process assets: OPA that can influence the Close Project or Phase process incl.
- Project or phase closure guidelines or requirements (e.g. admin procedures, project audits etc.)
- Historical information and lessons learned knowledge base (e.g. project records and documents etc.)

Tools & Techniques
1) Expert judgement: applied when performing administrative closure activities, these exports ensure that project or phase closure is performed to the appropriate standards.

2) Analytical technique:examples of analytical techniques used in project closeout are
- Regression analysis
- Trend analysis

3) Meetings: may be face-to-face, virtual, formal or informal. Types of meetings include lessons learned, closeout, user group and review meetings.

Outputs
1) Final product, service or result transition: this output refers to the transition of the final product, service or result that the project was authorized to produce.

2) OPA updates: OPA that are updated as a result of the Close Project or Phase process include project files, closure documents and historical information