Monday, May 5, 2014

What is the purpose android source code is compiled, the compiler will get what?


I have in the post (the purpose of compiling android source code is valid http://bbs.csdn.net/topics/360094916) seen this problem, but still does not solve my doubts. Some people say that in order to compile the android source code to customize the system, I have the following questions:
1 How to compile the source code to implement custom? I read some information, it seems that it compiled directly download the source code, then compile something out of everyone not all the same? How to customize it?
2. Before compiling the source code if you want to be cut? How to crop? Is it because the source is cropped just want to compile source code?
3 to get the system in addition to the compiled source text and image pieces system.img userdate.img, I see there are tools in the SDK to generate some data, SDK to compile source code generation tool is it?

Novice wing boss also hope you, thank you!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
The first feeling you made a mistake referent called to compile the source code should be mainly refers to the engineering source code (ie, mobile phone manufacturers to build the entire rom code, including kernel, drivers, middle layer, a different code for each different chip manufacturers, framework, and applications, etc.) The source code than Google to release a lot richer and better target Google's set of source code is not implemented is empty
Do not know this, understand, because Google generates source code in addition to the simulator, feeling like no other to achieve (for example, many can not be achieved in the simulator)
Second, in order to obtain the compiler source code is usually hidden api, api sdk provided because some are not provided, but it does exist in the source code can be compiled by
Secondly, the mobile phone manufacturers are sure to compile source
Also some what some fans may also compile change something to play
Others leave it to others to add it
Reply:
Q1. How to compile the source code to implement custom? I read some information, it seems that it compiled directly download the source code, then compile something out of everyone not all the same? How to customize it?
A: First, on the premise that you customized source code is modified, whether you changed anything can be called a custom, as the custom of doing, there are two possibilities, one is you are selling android devices, but you are a folk rom development expert
Q2. Before compiling the source code if you want to be cut? How to crop? Is it because the source is cropped just want to compile source code?
A: Source which is divided into multiple folders vender which is what you need to add something, generally do not need to cut, unless you want to get rid of some of the things the system, another kernel drivers are needed, such as the manufacturers own custom.
Q3. Compiled source code to get the system in addition to text and image pieces system.img userdate.img, I see there are tools in the SDK to generate some data, SDK to compile source code generation tool is it?
A: Yes (should be)


Also upstairs is right to say
Reply:
Thank you upstairs enthusiastic answer, I probably got it, but I want to ask about the second floor, assuming that I was selling android devices, I need a run on my device android system is not necessary in the source system customize my driving, cutting some unnecessary stuff, and then compiled to get my customized system, the process is not like that?
System customization process is not so: Get source code -> modify the source code (including modifications and cropping) -> compile the modified source code -> get the target system file -> Transplant System -> Test Successful -> Done?


Thank you!
Reply:
reference to the third floor bingtianlong reply:
Thank you upstairs enthusiastic answer, I probably got it, but I want to ask about the second floor, assuming that I was selling android equipment I need an android system to run on my device is not necessary to customize the system source code in my drive, cutting some unnecessary stuff, and then compiled to get my customized system, the process is not so Son?
System customization process is not so: Get source code -> modify the source code (including modifications and cropping) -> compile the modified source code -> get the target system file -> Transplant System -> Test Successful -> Done?


Thank you!

Yes, the basic process is like this one!
Reply:
Think of someone like me, for this kind of thing in question,
The study, thank you question the landlord of this problem. .
Common progress. .

Android Baidu Location Map


Urgent! ! ! Great God help us to see new demand, I have Android applications, through the development of guidelines development platform called Baidu Baidu map, Baidu map also shows, I want to ask, how, depending on the latitude and longitude, mark this point in Baidu map, then This point occurs when moving, you can display the track. I give on the part of the code, seeking to modify.
AndroidMainfest.xml and layout files do not write, here is the main program:

public class MyMapActivity extends Activity

{

private BMapManager mBMapMan = null;
private MapView mMapView = null;

@ Override
public void onCreate (Bundle savedInstanceState)
{
super.onCreate (savedInstanceState);
mBMapMan = new BMapManager (getApplication ());
mBMapMan.init (null);

/ / Note: Please initialize BMapManager object before trial setContentView, otherwise it will error
setContentView (R.layout.activity_my_map);
mMapView = (MapView) findViewById (R.id.bmapsView);
mMapView.setBuiltInZoomControls (true);
/ / Set to enable the built-in zoom controls
MapController mMapController = mMapView.getController ();
GeoPoint point = new GeoPoint ((int) (39.915 * 1E6), (int) (116.404 * 1E6));
/ / With a given latitude and longitude to construct a GeoPoint, units are micro (degrees * 1E6)
mMapController.setCenter (point) ;/ / set the center of the map

mMapController.setZoom (12) ;/ / set the map zoom level
}
@ Override
protected void onDestroy ()
{

mMapView.destroy ();

if (mBMapMan! = null)
{
mBMapMan.destroy ();
mBMapMan = null;
}

super.onDestroy ();
}


@ Override
protected void onPause ()
{

mMapView.onPause ();
if (mBMapMan! = null)
{
mBMapMan.stop ();


super.onPause ();
}
}

@ Override
protected void onResume ()
{

mMapView.onResume ();
if (mBMapMan! = null)
{
mBMapMan.start ();
}

super.onResume ();

}
}
Great God, please paste the key code and key comments, please!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Regularly updated, each refresh the coordinates and then draw a track record
Reply:
Can you point to a specific point code

RelativeLayout background selector, it will not in the end is how is it? ? What's wrong? ?


Used in the background I choose RelativeLayout will not do, there is no effect,
Used in the picture there on the line, there is the effect, in the end is how is it? ?
Background Selector:
  

android: state_pressed = "true"
android: drawable = "@ color / bg_clicked" />




Layout:
 
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: background = "@ drawable / navi_bg_selector"
android: layout_weight = "1">
.........

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Need to give your job RelativeLayout registered onClick event
Reply:
Against this background selector should be space for it in terms of layout plus a choice, it may be in conflict with the gesture.
I also guess, if you find the answer to the possibility of sharing the landlord, but also the way to learn about
Reply:
reference to the second floor u014081087 reply:
this background selector should be space for it in terms of adding a layout selector may play with gestures conflict.
I also guess, if you find the answer to the possibility of sharing the landlord, but also the way to learn about

Resolved, the original is the lack of a configuration:
android: clickable = "true"

android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: background = "@ drawable / navi_bg_selector"
android: clickable = "true"
android: layout_weight = "1">
.........

Android Tabhost no error code is not open ah, beg Great God! ! !


First on error

Error code
 04-15 21:50:15.332: D / AndroidRuntime (1042): Shutting down VM 
04-15 21:50:15.332: W / dalvikvm (1042): threadid = 1: thread exiting with uncaught exception (group = 0x41465700)
04-15 21:50:15.342: E / AndroidRuntime (1042): FATAL EXCEPTION: main
04-15 21:50:15.342: E / AndroidRuntime (1042): java.lang.RuntimeException: Unable to start activity ComponentInfo {com.example.tabhost / com.example.tabhost.MainActivity}: java.lang.RuntimeException: Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.ActivityThread.performLaunchActivity (ActivityThread.java: 2211)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java: 2261)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.ActivityThread.access $ 600 (ActivityThread.java: 141)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.ActivityThread $ H.handleMessage (ActivityThread.java: 1256)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.os.Handler.dispatchMessage (Handler.java: 99)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.os.Looper.loop (Looper.java: 137)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.ActivityThread.main (ActivityThread.java: 5103)
04-15 21:50:15.342: E / AndroidRuntime (1042): at java.lang.reflect.Method.invokeNative (Native Method)
04-15 21:50:15.342: E / AndroidRuntime (1042): at java.lang.reflect.Method.invoke (Method.java: 525)
04-15 21:50:15.342: E / AndroidRuntime (1042): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 737)
04-15 21:50:15.342: E / AndroidRuntime (1042): at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 553)
04-15 21:50:15.342: E / AndroidRuntime (1042): at dalvik.system.NativeStart.main (Native Method)
04-15 21:50:15.342: E / AndroidRuntime (1042): Caused by: java.lang.RuntimeException: Your content must have a TabHost whose id attribute is 'android.R.id.tabhost'
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.TabActivity.onContentChanged (TabActivity.java: 131)
04-15 21:50:15.342: E / AndroidRuntime (1042): at com.android.internal.policy.impl.PhoneWindow.setContentView (PhoneWindow.java: 270)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.Activity.setContentView (Activity.java: 1895)
04-15 21:50:15.342: E / AndroidRuntime (1042): at com.example.tabhost.MainActivity.onCreate (MainActivity.java: 22)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.Activity.performCreate (Activity.java: 5133)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java: 1087)
04-15 21:50:15.342: E / AndroidRuntime (1042): at android.app.ActivityThread.performLaunchActivity (ActivityThread.java: 2175)
04-15 21:50:15.342: E / AndroidRuntime (1042): ... 11 more


Layout:
 xmlns: tools = "http://schemas.android.com/tools" 
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: paddingBottom = "@ dimen / activity_vertical_margin"
android: paddingLeft = "@ dimen / activity_horizontal_margin"
android: paddingRight = "@ dimen / activity_horizontal_margin"
android: paddingTop = "@ dimen / activity_vertical_margin"
tools: context = "com.example.tabhost.MainActivity $ PlaceholderFragment">

android: id = "@ android: id / tabhost"
android: layout_width = "match_parent"
android: layout_height = "match_parent">

android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: orientation = "vertical">

android: id = "@ android: id / tabs"
android: layout_width = "match_parent"
android: layout_height = "wrap_content">


android: id = "@ android: id / tabcontent"
android: layout_width = "match_parent"
android: layout_height = "match_parent">

android: id = "@ + id/tab1"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: orientation = "vertical">
android: id = "@ + id/txt1"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "one" />



android: id = "@ + id/tab2"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: orientation = "vertical">
android: id = "@ + id/txt2"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "two" />


android: id = "@ + id/tab3"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: orientation = "vertical">










MainActivity code
 package com.example.tabhost; 

import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;
import android.app.TabActivity;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class MainActivity extends TabActivity {

@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);
TabHost host = getTabHost ();
host.setup ();

TabSpec tab1 = host.newTabSpec ("tab1");
tab1.setIndicator (getResources () getString (R.string.tab1).);
tab1.setContent (R.id.tab1);
host.addTab (tab1);

TabSpec tab2 = host.newTabSpec ("tab2");
tab2.setIndicator (getResources () getString (R.string.tab2).);
tab2.setContent (R.id.tab2);
host.addTab (tab2);

TabSpec tab3 = host.newTabSpec ("tab3");
tab3.setIndicator (getResources () getString (R.string.tab3).);
tab3.setContent (R.id.tab3);
host.addTab (tab3);

host.setCurrentTab (0);
}



@ Override
public boolean onCreateOptionsMenu (Menu menu) {

/ / Inflate the menu; this adds items to the action bar if it is present
.getMenuInflater () inflate (R.menu.main, menu);.
return true;
}

@ Override
public boolean onOptionsItemSelected (MenuItem item) {
/ / Handle action bar item clicks here. The action bar will
/ / Automatically handle clicks on the Home / Up button, so long
/ / As you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId ();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected (item);
}

/ **
* A placeholder fragment containing a simple view.
* /
public static class PlaceholderFragment extends Fragment {

public PlaceholderFragment () {
}

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

}


String code


  


tabhost
Hello world!
Settings
picture 1
Screen 2
screen 3




These, knees and begged God to help more big ah! ! ! !
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
tools: context = "com.example.tabhost.MainActivity $ PlaceholderFragment" Here are removed to change the dollar sign and back under test.
Reply:
The amount of ... your tabhost is defined in fragment.xml inside of it, you put setContentView (R.layout.activity_main); inside the file into your layout that define tabhost

Compile android source, suggesting that no arm-linux-androideabi-gcc.


I was so compiled:
root @ mimixi666-virtual-machine :/ my/source/android4.0 # make init
But mistakes

/ bin / bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-
androideabi-gcc: No such file or directory
/ Bin / bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-
androideabi-gcc: No such file or directory
/ Bin / bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-
androideabi-gcc: No such file or directory
/ Bin / bash: bison: command not found
==================================== ========
PLATFORM_VERSION_CODENAME = REL
PLATFORM_VERSION = 4.0.1
TARGET_PRODUCT = full
TARGET_BUILD_VARIANT = eng
TARGET_BUILD_TYPE = release
TARGET_BUILD_APPS =
TARGET_ARCH = arm
TARGET_ARCH_VARIANT = armv7-a
HOST_ARCH = x86
HOST_OS = linux
HOST_BUILD_TYPE = release
BUILD_ID = ITL41D
============================================
prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc -
mthumb-interwork -Ibionic/libc/private-DCRT_LEGACY_WORKAROUND -Ibionic/libc/private-o
out / target / product / generic / obj / lib / crtbegin_static.o-c bionic/libc/arch-
arm / bionic / crtbegin_static.S
/ Bin / bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-
androideabi-gcc: No such file or directory
make: *** [out / target / product / generic / obj / lib / crtbegin_static.o] Error 127

But obviously there acridine below. .
root @ mimixi666-virtual-machine :/ my/source/android4.0/prebuilt/linux-x86/toolchain/arm-
linux-androideabi-4.4.x/bin # ls
arm-linux-androideabi-addr2line arm-linux-androideabi-gprof
arm-linux-androideabi-ar arm-linux-androideabi-ld
arm-linux-androideabi-as arm-linux-androideabi-ld.bfd
arm-linux-androideabi-c + + arm-linux-androideabi-ld.gold
arm-linux-androideabi-c + + filt arm-linux-androideabi-nm
arm-linux-androideabi-cpp arm-linux-androideabi-objcopy
arm-linux-androideabi-g + + arm-linux-androideabi-objdump
arm-linux-androideabi-gcc arm-linux-androideabi-ranlib
arm-linux-androideabi-gcc-4.4.3 arm-linux-androideabi-readelf
arm-linux-androideabi-gccbug arm-linux-androideabi-run
arm-linux-androideabi-gcov arm-linux-androideabi-size
arm-linux-androideabi-gdb arm-linux-androideabi-strings
arm-linux-androideabi-gdbtui arm-linux-androideabi-strip

In the end they do wrong? ?
And my system has a relationship? ?
I am a 64-bit virtual machine ubuntu, but also 64 of the mirror. .

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Forget is how to solve, anyway, then simply plug these libraries:
apt-get install git-core gnupg flex bison gperf
build-essential zip curl zlib1g-dev libc6-dev
lib32ncurses5-dev x11proto-core-dev libx11-dev
lib32z-dev libgl1-mesa-dev g+ +-multilib mingw32
tofrodos python-markdown libxml2-utils xsltproc
libx11-dev: i386 gcc-4.4 lib32z1 lib32readline-gplv2-dev
g+ + -4.4 gcc-4.4

It will not happen again this problem. .

Ask: If the micro-channel public platform news and information such as how to deal with the style box




Consult composite frame such as micro-channel platform to send public figure, how to deal with the style sheet, please advice.

 

android: id = "@ + id / messageArrayAdapterLinerlayout"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: layout_gravity = "center_vertical"
android: orientation = "vertical">

android: id = "@ + id/complexMessage_layout0"
android: layout_width = "fill_parent"
android: layout_gravity = "center_horizontal"
android: layout_height = "wrap_content">

android: id = "@ + id/complexMessage_image0"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: scaleType = "centerInside" />

android: id = "@ + id/complexMessage_text0"
android: layout_width = "fill_parent"
android: layout_gravity = "bottom"
android: gravity = "center_horizontal"
android: textSize = "18dp"
android: layout_height = "wrap_content" />


android: id = "@ + id/complexMessage_layout1"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
>
android: id = "@ + id/complexMessage_text1"
android: layout_gravity = "right"
android: textSize = "9dp"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content" />

android: id = "@ + id/complexMessage_image1"
android: layout_width = "40dp"
android: layout_height = "40dp"
android: layout_gravity = "left"
android: scaleType = "fitXY" />


android: id = "@ + id/complexMessage_layout2"
android: layout_width = "match_parent"
android: layout_height = "wrap_content"
android: orientation = "horizontal"
>
android: id = "@ + id/complexMessage_text2"
android: layout_gravity = "right"
android: textSize = "9dp"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content" />

android: id = "@ + id/complexMessage_image2"
android: layout_width = "40dp"
android: layout_height = "40dp"
android: layout_gravity = "left"
android: scaleType = "fitXY" />






Wrote one, found completely impossible,
1, textView the width of the first piece of news I do not know how to be consistent with the picture, how to deal with its wrap, its background, and how to deal with a transparent background.
2, textView width does not know how to define. The second and third news how fixed textView, IMAGEVIEW width, so that they happened to be the father of width + up
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This is a ListView
Reply:
cited a floor hjywyj reply:
this is a ListView


Well, this is indeed a LISTVIEW, the main question is this message box layout how to write
Reply:
Rub, it is obvious it is jmobile + html5, html5 micro-channel platform for direct display of it,,,
Reply:
1 can learn android listView can refer http://www.cnblogs.com/xiaowenji/archive/2010/12/08/1900579.html
2.ImageView can be removed, you can use only one TextView, insert images directly in the listview in control through pictures and text drawablePadding control code from the adapter to the TextView by textView.setCompoundDrawables way to dynamically set pictures
Reply:
references, 4th Floor blovecat reply:.
1 can learn android listView can refer http://www.cnblogs.com/xiaowenji/archive/2010/ 12/08/1900579.html
2.ImageView can be removed, you can use only one TextView, insert images directly in the listview in control through pictures and text drawablePadding control code from the adapter to the TextView by textView.setCompoundDrawables way to dynamically set the picture < / blockquote>


Thank you reply, I'll go have read about.
Reply:
references, 5th Floor zzytn reply:
Quote: references to the 4th floor blovecat reply:

1 can learn android listView can refer http://www.cnblogs.com/xiaowenji/archive/2010/12/08/1900579.html
2.ImageView can be removed, you can use only one TextView, insert images directly in the listview in control through pictures and text drawablePadding control code from the adapter to the TextView by textView.setCompoundDrawables way to dynamically set the picture < / blockquote>


Thank you reply, I'll go have read about.


Just looked, LAYOUT or simply some, it is mainly about this LAYOUT how to draw, ArrayAdapter write this class has inherited.
Reply:
Is a listview just put a different type, the kind of effect only into two types Bale
Reply:
Thank you for your reply, Citie has knot, is posted above me LAYOUT, slightly adjust it.

While every sink, but I still brazen to ask questions! ! !


Two notification problem:
1.notification how to be able to remind only once, or not to remind the corresponding activity, but are also reminded of the information, or have in the status bar when no reminder! Or not repeated reminders! (Now the situation is such that every once went to check the data, the data will remind! That case, notification will always remind, will make people bored!)
2.ActivityGroup, all the activity is through the following code into a view then add ActivityGroup, the code goes
 / / To jump interface 
Intent intent = new Intent (this, B.class) addFlags (Intent.FLAG_ACTIVITY_CLEAR_TOP);.
/ / Put an Activity into a View
. Window w = group.getLocalActivityManager () startActivity ("B", intent);
View view = w.getDecorView ();
/ / Add the View large ActivityGroup in
group.setContentView (view);

Use notification alert is normal in ActivityGroup, but prompted click the status bar to jump to the corresponding activity, that will create a new activity, and this activity is not ActivityGroup, and will cover the following tab label! I ask how can click on the status bar to prompt new activity added to ActivityGroup in!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
1.notification.flags | = Notification.FLAG_ONLY_ALERT_ONCE; together with this property if this provision is no longer ringing or vibrating notification in the notification bar prompts
Notification bar shows the current notification has been Andrews is impossible to get, you can think of ways to use log files to record the way, showing what is recorded, which can record your current show whether you need to display a notification message, I click to
jump to the first empty your default interface need to jump jump to transit interface, to be transit, the transit time records do show clear action2 Click certainly will jump to a new interface, this is basically impossible to avoid
Reply:
cited a floor z_sawyer reply:
1.notification.flags | = Notification.FLAG_ONLY_ALERT_ONCE; together with this property if this entry is already in the notification bar is no longer notice ringing or vibrating alert
Notification bar shows the current notification has been Andrews is impossible to get, you can think of ways to use log files to record the way, showing what is recorded, which can record your current show whether you need to display a notification message, I click to
jump to the first empty your default interface need to jump jump to transit interface, to be transit, the transit time records do show clear action2 Click certainly will jump to a new interface, this is basically impossible to avoid
thanks!