Saturday, March 29, 2014

Use SurfaceView camera with Camera development issues


When I use urfaceView camera with Camera development problems encountered have been unable to resolve the following issues:

1 I use the Camera's setPreviewSize set the camera viewfinder image size, no matter how the result set, all without any change, already fully occupied throughout the SurfaceView;

(2) I-related activity in the Manifest.xml where to set the android: configChanges = "orientation | keyboardHidden", but still the screen will turn the incident, when changing the orientation of the phone, the screen will flash and camera viewfinder screen orientation will change;

3 in the vertical screen, the viewfinder image is rotated 90 degrees to the left, causing the image is not correct; When I put the phone horizontally when the problem first occurred two and then framing the image orientation becomes normal;

How to solve these problems, I can not even get a couple of days, please let me know.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Fixed direction chant, let Activity rotation
Reply:
After fixation, there will be a 90-degree deflection shot out of the question in a certain direction photo and video shooting happened, because this time fixed Activity, you can not know whether to go deal with the rotation this photo
Reply:
The reply was deleted at 2011-04-25 09:12:06 moderator

Reply:
The first question: You can set the width and height in the xml surfaceView in,
The second question: this.setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); onCreate method in the activity of the insert, but again the front setContentView.
Reply:
I also encountered the same problem. Yet to be resolved,
Reply:
Into the camera, the device is rotated 90 °, even if the screen does not move, framework will listen to the Orientation events, camera zeroed not normal.
Reply:
Set attribute android: orientation = "landscape" or android: orientation = "portrait" orientation can be fixed. You try to influence the size of the object with the surface of surfaceholder setpreviewSize (int, int) attribute set.
Reply:
I have encountered this problem, now resolved.
Our products are in landscape fullscreen, preview appears rotated 90 degrees, portrait preview properly.
My current practice is carried out under the layout portrait changes, will become the landscape look like when it changes, and will not appear rotated, but there has been tension in the preview pictures.

Goals I want to achieve is to not change the layout, preview SurfaceView by rotating the above frame to achieve the desired effect, but now I do not know how to spin.
Some of the ways to find online is the basic set ("orientation", "portrait"), set ("rotation", "90"); There is set in xml. These methods I have tried, no.

I tried a bit to adjust by rotating SurfaceView preview rotation, try some methods too. Anyone tried this approach?

In addition, data access and each frame in the preview when I was onPreviewFrame by BitMap rotation, too.
Some foreigners see on the website, some say it's a Bug 2.1 system in future versions to solve this problem, individuals agree with this, there is such a method setDisplayOrientaton In version 2.2 and later of () seems to be resolved.

I saw the Huawei mobile phones, 2.1 system, has solved this problem.

These are some of the things I found this time to solve this problem, but the problem is still not resolved, I hope someone can give some help.
Reply:
How to set the size of the camera when it?
Reply:
http://blog.csdn.net/xys289187120/article/details/6575830
I hope this article can help to you
Reply:
Thank you very much
Reply:
Thank you, I'm looking for a custom camera system upstairs is calling camera, and I want to achieve in the camera when resizing can be achieved,
Reply:
The landlord did not get this up?
Reply:
Landlord to solve this problem?
Reply:
Landlord, is how to solve your problem, and I am a student, and now doing a work, encountered such a problem.

Android development for serial communication doubts, can not communicate


google official website has a corresponding serial assistant download something similar, but it will not. On-line to find a better day's data, some of the source code under test whether serial communications. To the final without success. Permissions are set (chmod 777 / dev / tty *), the SerialPort.c also changed fd = open (path_utf, O_RDWR | flags);. Finally, the return value when using fd are 47/49/46, and instead of -1. Is Open success. But I do not think so. After connecting to a computer via pc using the serial cable, sending data, has not been here. The most curious question than using online information source on each tablet are optional ttyS0, ttyS1, ttyS2, ttyS3, ttyS4, ttyS5, ttyS6, ttyS7, ttyGS0, ttyGS1, ttyGS2, ttyGS3 these settings It seems not what I wanted. But whether it is checked whether the tablet computer because drivers need, or that did not find / identify the driver, forcing it to find the corresponding port number. In the windows system developers are aware that corresponds pc COM1 port numbers are like. Tty to android is like. However, the use of open android using pc connection to view its system files, only to see nothing more than to tty63/ttyGS0 tty/tty1 to ttyGS3/ttyS0 to ttyS7, some users do not see the Internet like talking ttyUSB0/s3c_serial2 port number. Can not understand. Own java development serial communication fairly understood, developed a number of similar projects, but now used to develop from the android, the confusion no other.

ps:
Originally hand equipment for: Android4.0.3 domestic Tablet PC + CH340 chip usb to serial cable (only accept data, you can not transmit data) + pc can send data / hardware devices can transmit data to a PC via a serial cable flat computer.

Confused better days. Not always solve the problem, can not communicate.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Give you a look at the top, not sounded understand the underlying point
Reply:
android development of serial point-tech really ah.
Reply:
In fact, just the kernel or not to support it. Now we finally get.
Reply:
Dude, how do you solve this issue? I have encountered this problem, and do not know ah.
Reply:
Results posted hate this way!

        


Reply:
I also followed the instructors do such a project. With the open-source android-serial-api.
You say that is not supported on kernel support issues, and finally how would you solve?
Reply:
I say How about you, you made this post in the end what does it mean to want to express
Reply:

Reply:
http://www.2cto.com/kf/201303/195382.html can learn from this, the test interface with.

android4.0 system broadcasting issues


public class test extends BroadcastReceiver {
@ Override
public void onReceive (Context context, Intent intent) {
/ / TODO Auto-generated method stub
Toast.makeText (context, "boot broadcasting", 1) show ();.
}

}
-------------------------------------------------- ------------







-----------------------------------------
Can not run on a 4.0 system. 2.3.6 in the system. Why. I used the Samsung 9100,4.0 system testing can not.

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
4.0.3 broadcast on the simulator systems can not. In the end is why? ? ? ?
What is not to add the code? ? ?
Online anxious
Reply:
Used properly, is how a landlord can not ah?
Reply:
No method into my radio inside. Simulator you can do? I tested the boot broadcast messages can not receive broadcast ah! 4.0 can not be 2.2. You see there is anything wrong with my code
Reply:
Android 4.0 reasons someone can not receive broadcast messages to resolve the matter yet
Reply:
4.0 above must be added the authority to boot
Reply:
I encountered this problem, is 4.0 to cancel the non-activity threading issues. Trouble ah
Reply:
Then how things right.
Reply:
Will someone solve this issue under it, bother me a long time
Reply:
Will someone solve this issue under it, bother me a long time
Reply:
Do not sink it ah! Some people know what to say about the class
Reply:
android 4.0 In order to prevent some malware (malicious software) without the user starts it running in the background, the default installation of the program before the user starts the system is completely ignored, even if the procedures for the registration of the radio, the system does not give the program passes broadcasts. Only after the user runs the program is over, the message broadcast to take effect. Moreover, even if the program has been run over, if the user Force Stop (forced stop), the system will return to the state of being ignored. This problem is actually from 3.1 when it already has, most recently with the 4.0 system testing discovered the existence of the problem, causing a lot of trouble.
Reply:
After 3.1, package manager system adds support for in "stopped state" application management, this stopped and Activity lifecycle stop state is entirely different things, means that after the installation has never been started and was forced to stop in the user manual applications at the same time the system increases the two Flag: FLAG_INCLUDE_STOPPED_PACKAGES and FLAG_EXCLUDE_STOPPED_PACKAGES, to identify whether an intent to activate in "stopped state" applications. When the two Flag is not set or is set when using a FLAG_INCLUDE_STOPPED_PACKAGES effect.

With the new system after the above, google feel all broadcast intent to default plus FLAG_EXCLUDE_STOPPED_PACKAGES will be very Cooooool, to avoid rogue software to some extent, the virus ah do bad things, but also improve efficiency, has led to the title of this article says The problem, RECEIVE_BOOT_COMPLETED broadcast over the application if the user is not running, it will not respond.

But google still left a little room for the broadcast custom we can

setFlags (Intent.FLAG_INCLUDE_STOPPED_PACKAGES); this method to wake up in the "stopped state" of the program, that is, the user can write their own broadcast intent to control this mechanism, but the system comes with a broadcast intent, because it is not modified, it can only accept this reality the

For example:

Intent startIntent = new Intent ();
startIntent.putExtra ("pkg", getPackageName ());
startIntent.setAction ("com.lenovo.speechcamera.start");
startIntent.setFlags (Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
sendBroadcast (startIntent);

How Netease news app, and tie off the loaded content such as news app is the effect of photo-text


How like Netease news app, and tie off such news app is photo-text content loaded effect is not limited to the number of images, and text can complete line up together, and the general web browsing the same effect
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
I think it should be the wap pages
Reply:
They are using WebView, then load custom HTML.
Reply:
I checked some information, that is loaded with webview, they each made separate pages are static files corresponding mobile terminals to suit different experience PC and mobile terminals, but colleagues say is responsible for the development is to figure out how likely visit html, and annoying
Reply:
webkit do shell, html pages do
Reply:
I'm doing a client-side is that you can photo-text, but not webview + html but to a text which has some html tags course, there are custom and custom methods to resolve the android can be dynamically displayed on the control the
Reply:
The key to be flexible on the line.
Reply:
webview is flawed in ios development, you can not very well go to control its release. NetEase coretext it should be 'free to draw and control layout, photo-text her. In addition there is mention mwf csdn

android client calls webservice reported abnormal, how it


 package Telephone.test; 

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class TelephoneActivity extends Activity {
/ ** Called when the activity is first created. * /
private EditText phoneSecEditText;
private TextView resultView;
private Button queryButton;
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
queryButton = (Button) findViewById (R.id.query_btn);
queryButton.setOnClickListener (new OnClickListener () {
public void onClick (View v) {

String username = phoneSecEditText.getText () toString () trim ();..
getRemoteInfo (username);
}
});

}
public void getRemoteInfo (String username) {
/ / Namespace
String nameSpace = "http://tempuri.org/";
/ / Method name
callString methodName = "GetUserList";
/ / EndPoint
String endPoint = "http://192.168.0.100:8081/WebService.asmx";
/ / SOAP Action
String soapAction = "http://tempuri.org/GetUserList";

/ / Specify WebService namespace and method name to call
SoapObject rpc = new SoapObject (nameSpace, methodName);

/ / Set the required incoming call WebService interface requires two parameters mobileCode, userId
rpc.addProperty ("username", username);


/ / Generate method call WebService SOAP request message, and specify the version of SOAP
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (SoapEnvelope.VER11);

envelope.bodyOut = rpc;
/ / Set whether the call is dotNet development WebService
envelope.dotNet = true;
/ / Equivalent to envelope.bodyOut = rpc;
envelope.setOutputSoapObject (rpc);

HttpTransportSE transport = new HttpTransportSE (endPoint);
try {
/ / Call WebService
transport.call (soapAction, envelope);
} Catch (Exception e) {
e.printStackTrace ();
}

/ / Get the returned data
SoapObject object = (SoapObject) envelope.bodyIn;
/ / Get the results returned
String result = object.getProperty (0) toString ();.
/ / String result = "lijian";

/ / Display the results returned by WebService in TextView in
resultView.setText (result);
}
}


<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Nobody answered yet
Reply:
Tip this error:
Reply:
Null pointer exception: phoneSecEditText not only defines the assignment, so in line 27 when this will be reported with a null pointer exception.
 String username = phoneSecEditText.getText (). toString (). trim () ;/ / here phoneSecEditText not assign it 

Find framebuffer convert BITMAP format code. 32-bit color.


Find framebuffer convert BITMAP format code. 32-bit color.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->

How to implement a custom form?


Hello everyone, on android inside custom form features I have not yet familiar. Now postings ask you friends.
For example, I want to add the information to implement database functionality, I want a button on the UI interface "add information" is set to listen for events, will pop up after clicking one of my own to do a custom form above may have "students learn "" Student Name "and other information required to complete. (Key: no jumps interface, just pop a custom form [not occupy the entire screen form, all the focus at the moment on this form], which is waiting for user input, and nothing more.) And then accepted Background processing information to determine whether successful.

The whole process is so, if we can imagine the younger brother of the screen, the trouble for some guidelines (the "custom form" what to do?), Thank you.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Dialog with it, see for yourself.
Reply:
Feeling like this, thank you for the reminder!
Reply:
android Custom Dialog
dialog large collection
Reply:
Use AlertDialog

How and C + + Builder website for HTTPS POST and GET?


How and C + + Builder website for HTTPS POST and GET?
Is sent to request and retrieve the results, do not display.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
C + + does not, C # will be a number of touches
Reply:
indy controls
Reply:
reference to the second floor wewaa reply:
indy controls


Whether there is a simple example code? Need to support HTTPS.
Reply:
Online plenty --- http://blog.csdn.net/beiguofengguang/article/ details/7396878
Reply:
DLL libraries themselves with OPENSSL get, thank you.

android call webservice dataset data is abnormal, which experts facie trouble


posts by fenghuanglijian on 2013-10-06 19:18:11 Edit
 package Telephone.test; 
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import org.xmlpull.v1.XmlPullParserException;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
public class TelephoneActivity extends Activity {
/ ** Called when the activity is first created. * /
private EditText usernameEditText;
private TextView resultView;
private Button queryButton;
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
usernameEditText = (EditText) findViewById (R.id.phone_sec);
resultView = (TextView) findViewById (R.id.result_text);
queryButton = (Button) findViewById (R.id.query_btn);
queryButton.setOnClickListener (new OnClickListener () {
public void onClick (View v) {

String username = usernameEditText.getText () toString () trim ();..
try {
List > newsdata = getSpecCatNews (username);
SimpleAdapter newslistAdapter = new SimpleAdapter (TelephoneActivity.this, newsdata, R.layout.main, new String [] {"task_title"}, new int [] {R.id.task_title});
ListView newslist = (ListView) findViewById (R.id.listview);
newslist.setAdapter (newslistAdapter);


} Catch (IOException e1) {
/ / TODO Auto-generated catch block6
e1.printStackTrace ();
} Catch (XmlPullParserException e1) {
/ / TODO Auto-generated catch block
e1.printStackTrace ();
}

/ / Try {
/ / GetRemoteInfo (username);
/ /} Catch (IOException e) {
/ / TODO Auto-generated catch block
/ / E.printStackTrace ();
/ /} Catch (XmlPullParserException e) {
/ / TODO Auto-generated catch block
/ / E.printStackTrace ();
/ /}
}
});
}

private List > getSpecCatNews (String username) throws IOException, XmlPullParserException {
List > newslist = new ArrayList > ();

/ / Namespace
String nameSpace = "http://tempuri.org/";
/ / Method name
callString methodName = "GetTaskUserName";
/ / EndPoint
String endPoint = "http://192.168.0.100:8081/WebService.asmx";
/ / SOAP Action
String soapAction = "http://tempuri.org/GetTaskUserName";
/ / Specify WebService namespace and method name to call
SoapObject rpc = new SoapObject (nameSpace, methodName);
/ / Set the required incoming call WebService interface requires two parameters mobileCode, userId
rpc.addProperty ("username", username);
/ / Generate method call WebService SOAP request message, and specify the version of SOAP
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (SoapEnvelope.VER12);
envelope.bodyOut = rpc;
/ / Set whether the call is dotNet development WebService
envelope.dotNet = true;
envelope.setOutputSoapObject (rpc);
HttpTransportSE transport = new HttpTransportSE (endPoint);
transport.call (soapAction, envelope);
/ / Get the returned data
SoapObject object = (SoapObject) envelope.bodyIn;
/ / Get the results returned
/ / Get the return result

for (int i = 0; i SoapObject soapChilds = (SoapObject) object.getProperty (i);
HashMap hashMap = new HashMap ();
/ / List.add (soapChilds.getProperty ("price20GP") toString ().);
hashMap.put ("task_title", soapChilds.getProperty ("TaskTitle") toString ().);
newslist.add (hashMap);
}
return newslist;

}


}
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Error prompt:
Reply:

Reply:
Do not sink paste ah. . . . . . . .

android how to set up another xml layout file TextView display values ​​in the Activity


How to set TextView to display the value of another xml layout file in the Activity in
See using this in an article:
LayoutInflater layout = this.getLayoutInflater ();
View view = layout.inflate (R.layout.login_stytle, null);
Button b = (Button) view.findViewById (R.id.b);

But how to change the button to display the value of it
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This feature is very strange
Reply:
cited landlord jiangbo_phd reply:
in Activity in how to set TextView display the value of another xml layout file
See using this in an article:
LayoutInflater layout = this.getLayoutInflater ();
View view = layout.inflate (R.layout.login_stytle, null);
Button b = (Button) view .......

b.setTextView (xxxxx);
Reply:
I tried ah, not so ah
Reply:
Activity can only change your own layout miss it
Reply:
Solved yet, encountered a similar problem
Reply:
b.setText ("");
Reply:
Encountered the same problem, settext not refresh!
There are ways to solve it? ?

DrawerLayout coverage is the main interface navigation interface


posts by xiaoguohaha edited 2013-10-04 16:00:58
 
android: layout_width = "match_parent"
android: layout_height = "match_parent">
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: id = "@ + id / drawer_layout">








include first is the layout of the main interface, the latter two include the left and right navigation layout, but it is always open to display the last run of a navigation layout solving, statckflow seemingly no problem in this regard, and limited English proficiency, Official documents scanty.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Seeking unsinkable, seeking answers
Reply:
Before you do not include the entire layout is normal for you
Reply:
reference to the second floor minlee1121 reply:
you do not include the entire layout is normal before you

Not normal, has been covered

Reply:
left drawer need to define attributes android: layout_gravity = "start" and android: layout_width <320dp
Similarly right drawer requires android: layout_gravity = "end" and android: layout_width <320dp

Not tested circumstances include, the latter should be allowed to include these two properties directly with it?

You can try to define android in user_layout: layout_gravity = "right" and specify a width of less than 320dp,
module_layout same treatment ("start" pass "left", "end" pass "right")

Why should we include? For reuse? If for reuse, you can try

 android: layout_width = "match_parent" 
android: layout_height = "match_parent">
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: id = "@ + id / drawer_layout">


android: id = "@ + id / left_drawer"
android: layout_width = "240dp"
android: layout_height = "match_parent"
android: layout_gravity = "start">


android: id = "@ + id / right_drawer"
android: layout_width = "300dp"
android: layout_height = "match_parent"
android: layout_gravity = "end">





Also: did not see the necessity of the outermost RelativeLayout, you can take a look Lint proposal
Reply:
references, 4th Floor hutu_cn reply:
left drawer need to define attributes android: layout_gravity = "start" and android: layout_width <320dp
Similarly right drawer requires android: layout_gravity = "end" and android: layout_width <320dp

Not tested circumstances include, the latter should be allowed to include these two properties directly with it?

You can try to define android in user_layout: layout_gravity = "right" and specify a width of less than 320dp,
module_layout same treatment ("start" pass "left", "end" pass "right")

Why should we include? For reuse? If for reuse, you can try

 android: layout_width = "match_parent" 
android: layout_height = "match_parent">
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: id = "@ + id / drawer_layout">


android: id = "@ + id / left_drawer"
android: layout_width = "240dp"
android: layout_height = "match_parent"
android: layout_gravity = "start">


android: id = "@ + id / right_drawer"
android: layout_width = "300dp"
android: layout_height = "match_parent"
android: layout_gravity = "end">





Also: did not see the necessity of the outermost RelativeLayout, you can take a look Lint proposal


3q, resolved, relativelayout is the online reference code examples

Why editText1 the OnKey event is executed twice Toast? how to avoid


posts by ilove8 edited 2013-10-02 21:49:54

When editText1 nulls Enter, tips can not be empty, but why each prompt is displayed twice, track a bit, the onKey event is executed twice.
The main code is as follows
 
editText1.setOnKeyListener (new View.OnKeyListener () {
@ Override
public boolean onKey (View arg0, int arg1, KeyEvent arg2) {
boolean bRet = false;
String s = editText1.getText () toString ();.
if (arg1 == KeyEvent.KEYCODE_ENTER) {
if (s.length () == 0) {
ShowToast ("can not be empty");

bRet = true;
}
}
return bRet;
}
});


edit1Text text control below there is edit2Text
 
android: layout_width = "match_parent"
android: layout_height = "wrap_content">

android: id = "@ + id/editText1"
android: layout_width = "0dip"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: singleLine = "true"
android: ems = "10">






android: layout_width = "match_parent"
android: layout_height = "wrap_content">

android: id = "@ + id/editText2"
android: layout_width = "0dip"
android: layout_height = "wrap_content"
android: layout_weight = "1"
android: singleLine = "true"
android: ems = "10" />




Two tips on how to avoid? Thank you
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
click the Enter key once, KeyEvent.ACTION_DOWN and KeyEvent.ACTION_UP are triggered View.OnKeyListener (), so Toast display twice. You can put
 if (arg1 == KeyEvent.KEYCODE_ENTER) 
changed
 if (arg1 == KeyEvent.KEYCODE_ENTER && arg2.getAction () == KeyEvent.ACTION_DOWN) 
or
 if (arg1 == KeyEvent.KEYCODE_ENTER && arg2.getAction () == KeyEvent.ACTION_UP) < / pre> This will only show Toast at press ENTER or ENTER key release time. 
You can also be changed according to need, when pressed and released, Toast display different strings.

Reply:
 if (arg1 == KeyEvent.KEYCODE_ENTER && arg2.getAction () == KeyEvent.ACTION_UP) 

Effective, thank you ah
No. QQ how much you add you look.
Reply:
Results posted!!

Asked one: android source code, how to switch versions.


Looking at Google's tutorial, download android source code.

Default branch is android-4.0.1_r1.
$ repo init-u https://android.googlesource.com/platform/manifest-b android-4.0.1_r1

Code download is complete, and also compile and run on a virtual machine.

The big question is:
how to code version 2.3.6 from 4.0.1 down to it?

Documents online to find a switch branch is unsuccessful.
question: is not switching branch, you can change the version of android code
?
Document as follows:
View switchable branch
cd .repo / manifests
git branch-a | cut-d /-f 3


With gingerbread-release branch for example
repo init-b gingerbread-release
repo sync (not needed if your local copy is up to date)
repo start gingerbread-release - all
View the current branch
repo branches


Android run in the root directory of the source code of this sentence:
repo init-b gingerbread-release

Error,
Information is as follows

yu @ yu-laptop: ~ / WORKING_DIRECTORY $ repo init-b gingerbread-release

... A new repo command (1.18) is available.
... You should upgrade soon:

cp / home / yu / WORKING_DIRECTORY / .repo / repo / repo / home / yu / bin / repo

Traceback (most recent call last):
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / main.py", line 408, in
_Main (Sys.argv [1:])
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / main.py", line 388, in _Main
result = repo._Run (argv) or 0
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / main.py", line 138, in _Run
result = cmd.Execute (copts, cargs)
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / subcmds / init.py", line 322, in Execute
self._SyncManifest (opt)
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / subcmds / init.py", line 192, in _SyncManifest
m.MetaBranchSwitch (opt.manifest_branch)
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / project.py", line 2151, in MetaBranchSwitch
self.Sync_LocalHalf (syncbuf)
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / project.py", line 1041, in Sync_LocalHalf
lost = self._revlist (not_rev (revid), HEAD)
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / project.py", line 1816, in _revlist
return self.work_git.rev_list (* a, ** kw)
File "/ home / yu / WORKING_DIRECTORY / .repo / repo / project.py", line 1961, in rev_list
p.stderr))
error.GitError: manifests rev-list ('^ 12303f87b9f90c07bf4aec4c4353ba514ee70c8a', 'HEAD', '-'): fatal: bad revision 'HEAD'


Begged heroes generous advice.

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Delete all files other than the repo repo folder directory, re-run the inti and sync, I tried to be.
Reply:
Very good, very good
Reply:
People do not prompt you
cp / home / yu / WORKING_DIRECTORY / .repo / repo / repo / home / yu / bin / repo
Perform the following, and then try to download!
Reply:
cited a floor Thinkingword reply:
delete all the files other than the repo repo folder directory, re-run the inti and sync, I tried. You can too.

Yes
Reply:
Test, the repo deleted, re-download the source code with what is the difference?
so it did not rub git

android how to obtain the source code of open source projects


Generally in line to see what the open source project, only to see the apk file, do not know how you can get the source code, seeking to inform, grateful
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
code.google.project or github above all possible
Reply:
cited a floor guoyoulei520 reply:
code.google.project or github above all possible

See a lot, I only see the installation files in github, can not find the source
Reply:
reference to the second floor yucheng0918 reply:
Quote: references to a floor guoyoulei520 reply:

code.google.project or github above all possible

See github lot, I only see the installation files, can not find the source

Look carefully, there are zip package under
Reply:
reference to the third floor guoyoulei520 reply:
Quote: references to the second floor yucheng0918 reply:

Quote: references to a floor guoyoulei520 reply:

code.google.project or github above all possible

See github lot, I only see the installation files, can not find the source

Look carefully, there are zip package under the

Thanks, I look to find

Every android emulator debuggers are very unhappy restart seek expert explained


target has also been set up correctly and selected avd
api level is also the same
System android3.0 api 11
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
How will restart it every time? Only need to first start AVD, after each debugger, you only need to uninstall the previous APK, re-install and run it.
Reply:
I also have several programs like this
Reply:
cited a floor reply:
how it will restart every time? Only need to first start AVD, after each debugger, you only need to uninstall the previous APK, re-install and run it.

Every day I turn first landing eclipse and then let run-> run as - after> android aplication will start an android avd then the program does not run again, I'll run my program will not restart another avd program has been loaded onto the open avd I closed eclipse turned off and then restart adb.exe close avd useless



Reply:
Adb process may be out of the question, ending adb.exe process in Task Manager, and then to the "android installation directory / platform-tools" run "adb.exe start-server". Just after this point to modify the program Run As-> Android Aplication can be re-loaded.
Reply:
4th floor roof, my problem solved
Reply:
Please do not specify a target, do not specify the best, there after you start to see your left ddms not show that there is a machine name, any other generally do not start up again unless your simulator is 2.2, then your program is 3.0
Reply:
Not like it
Reply:
Summarize what has been resolved to re-appear every reason to exclude api login first version of different issues, and then to choose the right version of the target, if not possible, then in the vicinity of devices ddms upper left corner there is a view menu click on Select reset adb so on it
Reply:
To see what is written, 4th Floor, thank you very much
Reply:
The reply was deleted at the moderator 2012-09-07 09:40:29

Reply:
silou
Reply:
reference to the third floor of the reply:
cited a floor reply:

How will restart it every time? Only need to first start AVD, after each debugger, you only need to uninstall the previous APK, re-install and run it.

Every day I turn first landing eclipse and then let run-> run as - after> android aplication will start an android avd then the program does not run again, I'll run my program will not restart another avd program has been loaded onto the open avd ......


If so tips that can be installed on the simulator, but have their own start the debugger how to do it?
[2012-10-10 16:40:01 - BusQuery] Installing BusQuery.apk ...
[2012-10-10 16:40:05 - BusQuery]! Success
[2012-10-10 16:40:05 - BusQuery] \ BusQuery \ bin \ BusQuery.apk installed on device
[2012-10-10 16:40:05 - BusQuery] Done!
Reply:
Well, fourth positive solution!
Reply:
Well, the fourth floor is correct, if there is no adb.exe under tools, you can go online and,
Reply:
Landlord mighty! Fourth floor of positive solutions
Reply:
4L powerful ah ~ ~ ~
Reply:
Fourth floor of positive solution, the problem will soon be solved.
Reply:
4th floor roof .... Thanks a million
Reply:
4L positive solutions, like this one
Reply:
I was done according to the fourth floor, but I "found under it is not" in the / platform-tools adb.exe start-server ", just adb.exe, do not know right

Service in onRebind () method is invoked when in the end!


Service in onRebind () method is invoked when in the end!

I see the document, but said that is not clear,
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
onRebind (Intent intent)
Called when new clients have connected to the service, after it had previously been notified that all had disconnected in its onUnbind (Intent).
Documents said very clearly, ah, after all bundled service and the old client contact between the onUnbind inside all over, if there is a new client with a bind connection service, will start onRebind ();
Reply:
Upstairs predecessors, roughly translated, I also know, but I really did not test out the code automatically call onRebind this way, I want to see how everyone is written, this method can be called automatically
Reply:
Would not it? ? Nobody?
Reply:
When the process is triggered when calling bindService service for your event onBind it.
My humble
Reply:
When after already bind, bind again will call ReBind (), how can not be measured. . .
Reply:
cited a floor yangwuweiyouwei reply:
onRebind (Intent intent)
Called when new clients have connected to the service, after it had previously been notified that all had disconnected in its onUnbind (Intent).
Documents said very clearly, ah, between service and the old client ......

+1
Baidu "android aidl " to know
Reply:
references, 4th Floor reply:
bindService when a process calls when your service will trigger an event of onBind it
.My humble

+1
Reply:
references, 5th Floor reply:
when after already bind, bind again will call ReBind (), how can not be measured. . .

+2
Reply:
The reply was deleted at the moderator 2012-11-01 17:28:37

Reply:
Seeking code, seeking truth
Reply:
http://mobile.51cto.com/android-315622.htm
Reply:
reference to the 11th floor liu_jun_y reply:
http://mobile.51cto.com/android-315622.htm

Thank you thank you, I just have encountered this problem, now understand! !

Why animationDrawable.start (); unable to perform in the onCreate


Or onStart or onResume too.
Solving.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
No code no truth.
Reply:
Yeah drink, you also like to have a code?
Reply:
animationDrawable a AnimationDrawable (nonsense ......)
Defined as follows:
imageView.setBackgroundResource (R.drawable.anim_list);
animationDrawable = (AnimationDrawable) imageView.getBackground ();
--------------- Listener will be able to play in a movie -------------------------- ------
imageView.setOnClickListener (new OnClickListener () {
@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
animationDrawable.start ();
}
});
--------------- Where it does not work in a onCreate ---------------------------- ----
@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
animationDrawable.start ();
}

Reply:
public void start ()

Added in API level 1
Starts the animation, looping if necessary. This method has no effect if the animation is running. Do not call this in the onCreate (Bundle) method of your activity, because the AnimationDrawable is not yet fully attached to the window. If you want to play the animation immediately, without requiring interaction, then you might want to call it from the onWindowFocusChanged (boolean) method in your activity, which will get called when Android brings your window into focus.

Similar figures message boards countdown of how to do it?


<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
What is the concept? Elaborate it
Reply:
cited a floor lihui_shine reply:
What is the concept? Detailed point it


Outside there is a rounded border, over time, reduce border clockwise a little lost.
Reply:
Understand the meaning of LZ said, it is indeed possible to achieve much trouble
If I came to realize, you can view with five colored to represent:
1, in the middle to the far right on the border
2, the right frame
3, the bottom border
4, the left border
5, on the border of the leftmost to the middle
5 view of the length / width narrowing, reduced to zero when the current one began to shrink next until the first five reduced to zero

These are personal humble opinion, I do not know there is no better way, which can be large cattle passing under the guidance of the words
Reply:
Thank you, I solved

Problem is automatically reset scroll view




 

android: id = "@ + id/h_scrollview_1"
android: layout_width = "match_parent"
android: layout_height = "100sp"
android: background = "# 778899"
>
android: id = "@ + id/linearlayout_1"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: background = "# 778899"
android: orientation = "horizontal"
>




android: id = "@ + id/v_scrollview_1"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: background = "# 998877"
android: layout_below = "@ + id/h_scrollview_1"
>

android: id = "@ + id/relativelayout_1"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: background = "# 007f7f"
>





As shown in yellow font, I use the xml in a horizontal scroll bar, and a vertical scroll bar, hoping accounted for one-third of the horizontal scroll bar, two-thirds of the vertical scroll bar in the xml file I do not know how to specify parameters, just write a 100sp, think again to update the program based on the pixel size of the screen.

At the prompt Logcat, the horizontal scroll bar is displayed by default 172 height, I used after layout is set to 283, the last line and automatically reverts to 172, I do not know what is the reason?

Do not use the layout settings reliable?
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Their research found that when the interface is redrawn, especially after the above layout is updated, affecting the following layout, they are refreshed, the position of which controls are automatically calculated.

Reply:
You this demand, the most appropriate is to use android: layout_weight specified proportion of the various spaces, which can adaptively various resolutions.
Reply:
reference to the second floor tantahe reply:
you this demand, the most appropriate is to use android: layout_weight specified proportion of each space, so you can customize adapt to a variety of resolutions.


How should specify the percentage of the parameters it?

Reply:
HorizontalScrollView the android: layout_weight = 2, ScrollView in android: layout_weight = 1, They the android: layout_height = "match_parent".
But there you have other LinearLayout and RelativeLayout, may affect the results.
Try it.

Gson how to parse Json array types


Heroes who, finding just learning Android, encounter a problem: Gson how to parse an array of type Json

Array types like:

{
"Count": 100,
"Page": 1,
"List": [{
"Title": "I",
"Tel": "110"
},
{
"Title": "you",
"Tel": "120"
}]
}

I do not know how to resolve this type of Json with gson, expect heroes have urged, it is best to have the code! Thank you!
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
No need to use Gson
JSONObject jsonObject = new JSONObject (String); this json data into an object.
Then JSONArray jsonArray = jsonObject.getJSONArray ("list"); obtain list data inside
for (int i = 0; i {
JSONObject jsonOb = (JSONObject) jsonArray.opt (i);
int tel = jsonOb.getInt ("tel");
}
Intermediate data read cycle
Reply:
 String json = "{start: 0, pageCount: 2, dataList: [{\" STRPRODUCTCODE \ ": \" DWJ100 \ ", \" STRVERSIONXZTEXT \ ": \" Initial installation package \ ", \" STRPRODUCTNAME \ ": \" Foreign Trade Enquiry System \ ", \" STRVERSIONTYPE \ ": \" 10 \ ", \" STRVERSIONID \ ": \" V1 \ ", \" STRVERSIONCODE \ ": \" 1.0.2.1018 \ ", \" LINE_NUM \ ": 1, \" STRVERSIONXZ \ ": \" 10 \ ", \" LIMIT \ ": 1, \" NUMSHOWORDER \ ": 1, \" STRVERSIONLOG \ ": \" fix a bug, increased 2 function \ ", \" STRVERSIONTYPETEXT \ ": \" Standard \ ", \" DATRELEASEDATE \ ": \" 2013-9-28 10:47:26 \ ", \" STRVERSIONFY \ ": \" 100,000 yuan \ ", \" STRSUPPORTOS \ ": \" Windows 2003/Windows 2008 \ ", \" STRDELFLG \ ": \" 0 \ "}" + 
", {\" STRPRODUCTCODE \ ": \" DWJ100 \ ", \" STRVERSIONXZTEXT \ ": \" Initial installation package \ ", \" STRPRODUCTNAME \ ": \" Foreign Trade Enquiry System \ ", \" STRVERSIONTYPE \ ": \ "10 \", \ "STRVERSIONID \": \ "V1 \", \ "STRVERSIONCODE \": \ "1.0.2.1018 \", \ "LINE_NUM \": 1, \ "STRVERSIONXZ \": \ "10 \ ", \" LIMIT \ ": 1, \" NUMSHOWORDER \ ": 1, \" STRVERSIONLOG \ ": \" fix a bug, increased 2 function \ ", \" STRVERSIONTYPETEXT \ ": \" Standard \ " , \ "DATRELEASEDATE \": \ "2013-9-28 10:47:26 \", \ "STRVERSIONFY \": \ "10 万 人民币 \", \ "STRSUPPORTOS \": \ "Windows 2003/Windows 2008 \ ", \" STRDELFLG \ ": \" 0 \ "}" +
"]}";
Gson gson = new Gson ();
JsonParser parser = new JsonParser ();
List > list = new ArrayList > ();
. JsonObject jsonObject = parser.parse (json) getAsJsonObject ();
JsonArray jsonArray = jsonObject.getAsJsonArray ("dataList");
Type type = new TypeToken > () {} getType ();.
for (int i = 0; i JsonElement el = jsonArray.get (i);
Map tmp = gson.fromJson (el, type);
list.add (tmp);
System.out.println (tmp.get ("STRPRODUCTCODE"));
}
jsonObject.remove ("dataList");
jsonObject.add ("dataList", parser.parse (gson.toJson (list)) getAsJsonArray ().);
System.out.println (gson.toJson (jsonObject));

Ask: Can get the code package name of the current program?


Current activity, there is no way to get the package name: like this com.test.www
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
yourclassName.this.getClass (). getPackage ()
Reply:
There are, ah, direct getPackageName () to

android


android phone Taobao project video, you need to raise their hands! ! ! !
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->

Background not full


New application:
Target SDK: API17: Adndroid4.2
Compile With: API18: Android4.3
Theme: Holo Light with Dark Actior Bar

Set up a 320 * 480 chart for the background in the code, in drawable-mdpi directory.


The same code with the picture, after running in full-screen display properly with the code works in the book.
I built a project where it is not full-screen on the right side is below the black, not full screen.
Personal feeling is that a relationship with the SDK version. My adt version is 20130729. Downloaded from the official website:
adt-bundle-windows-x86-20130729.

Get a long time, been unable to find the reason.
First, be sure not code thing.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Code impress with screenshots look
Reply:


 package com.example.zbgtest; 


import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;

public class mySur extends SurfaceView implements Callback {
private Canvas canvas;
private Paint paint;
private SurfaceHolder holder;
private boolean flag;
private Bitmap bmpBg;
private MyThread th_draw;

public mySur (Context context) {
super (context);
/ / TODO Auto-generated constructor stub
flag = true;
holder = getHolder ();
holder.addCallback (this);
paint = new Paint ();
paint.setColor (Color.WHITE);
bmpBg = BitmapFactory.decodeResource (this.getResources (), R.drawable.menu);
}

public void logic () {

}
public void reallyDraw () {
canvas.drawBitmap (bmpBg, 0, 0, paint);
}

public void draw () {
try {
canvas = holder.lockCanvas ();
if (canvas! = null) {
reallyDraw ();
}
} Catch (Exception e) {

} Finally {
if (canvas! = null) {
holder.unlockCanvasAndPost (canvas);
}
}
}

class MyThread extends Thread {
private int time;

public MyThread (int time) {
this.time = time;
}

@ Override
public void run () {
while (flag) {
try {
draw ();
logic ();

Thread.sleep (time);
} Catch (InterruptedException e) {
/ / TODO Auto-generated catch block
e.printStackTrace ();
}
}
}
}



@ Override
public void surfaceChanged (SurfaceHolder arg0, int arg1, int arg2, int arg3) {
/ / TODO Auto-generated method stub
th_draw = new MyThread (50);
th_draw.start ();
}


@ Override
public void surfaceCreated (SurfaceHolder arg0) {
/ / TODO Auto-generated method stub

}


@ Override
public void surfaceDestroyed (SurfaceHolder arg0) {
/ / TODO Auto-generated method stub
flag = false;
}





}


 package com.example.zbgtest; 

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

public class MainActivity extends Activity {

@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (new mySur (this));
}




}


  
package = "com.example.zbgtest"
android: versionCode = "1"
android: versionName = "1.0">

android: minSdkVersion = "8"
android: targetSdkVersion = "17" />

android: allowBackup = "true"
android: icon = "@ drawable / ic_launcher"
android: label = "@ string / app_name"
android: theme = "@ android: style / Theme.NoTitleBar.Fullscreen"
>
android: name = "com.example.zbgtest.MainActivity"
android: label = "@ string / app_name">











Reply:
If you simulator resolution is 320 * 480, should not have a black border.
If other resolutions, the background image will be proportionally enlarged or reduced, but not tensile deformation, so that may have black edges.
After you use the estimated 480 * 800 resolution, image scaling, etc., will be black bars at the bottom.
Reply:
I also tried on his android phone, and use my own code there will be a black border, and replaced the book comes with a code that is full-screen,
The picture is the same ah ~
Also I put the above code into the code works in the book, but also full-screen.
You can run my own project is to have a black border ...
Reply:
My eclipse, step ADT New Project screenshot:





Help us to see.
Reply:
Oh, dpi problem. One picture shows a different dpi resolution on the same phone is not the same effect. You put the picture on the next hdpi directory try.
Reply:


Reply:
drawable-ldpi, mdpi, hdpi have tried,
Ldpi placed below the display screen will be exceeded.
Hdpi placed below the display is smaller than with the above display.
On mdpi Here is the above effect.
Reply:
reference to the 8th floor zlgkaixin68 reply:
drawable-ldpi, mdpi, hdpi have tried,
Ldpi placed below the display screen will be exceeded.
Hdpi placed below the display is smaller than with the above display.
On mdpi Here is the above effect.

Reply:
canvas.drawBitmap (bmpBg, 0, 0, paint);
==>
canvas.drawBitmap (bmpBg, null, new RectF (0, 0, w, h), paint);
Reply:
10th Floor, Thanks so much, has full screen.
Reply:
Also, anyone know the reason for the above problem is?

Share on Twitter qq space integration


New to android soon, the project to integrate Sina Tencent microblogging certification, feeling a little trouble, ask, there are wood integrated demo ah?
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Big knees and begged God! ! !
Reply:
Baidu Alliance, which has a social component, there are demo integrates conventional social certification, you can use the
Reply:
I have always been UF alliance before the update process, which did not pay attention to the socialization of components, buttoned Results posted!

Ask a white Question: Android software protection


Android software did not understand the current protection is how to do, or whether to protect.
On the pc platform, protecting Java products seem generally is used with confused. Of course, there are a lot of tools to deal with this decompiler.
Then it developed on the Android platform, if it is written in Java, so how to protect? Or confuse you? Or google new approach. Seeking the truth.
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Confusion, NDK
Safety is relative, there is no absolute security.
Reply:
The reply was deleted administrator at 2013-10-09 14:04:20

This effect is how to do?


Slide the page, how to do it in the current page, previous page, and also shows part of the page. Give tips please?

Rabbit with 3.0 and Kaleidoscope video as video. .
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Come ah. . .
Reply:
Is not that right
galleryCurrently selected zoom certain proportion will naturally see the next two
Reply:
The principle and viewpager same.
Reply:
reference to the second floor guoyoulei520 reply:
is not this gallery you
Currently selected zoom certain proportion will naturally see the next two
how to set? Thank you so much.
Reply:
reference to the third floor wlcw16 reply:
principle and viewpager same.
I am now using viewpager do, but how that get displayed on both sides? Thank you
Reply:
references, 5th Floor jjhaowei reply:
Quote: references to the third floor wlcw16 reply:

The principle and viewpager same.
I am now using viewpager do, but how that get displayed on both sides? Thank you

This time you can display a screen of it. The gallery can display multiple, you put down the middle of the zoom ....


Reply:
reference to the 6th floor guoyoulei520 reply:
Quote: references, 5th Floor jjhaowei reply:

Quote: references to the third floor wlcw16 reply:

The principle and viewpager same.
I am now using viewpager do, but how that get displayed on both sides? Thank you

This time you can display a screen of it. The gallery can display multiple, you put down the middle of the zoom ....

say that this effect is gallery they do it? I would like to do with viewpager
Reply:
reference to the 7th floor jjhaowei reply:
Quote: references to the 6th floor guoyoulei520 reply:

Quote: references, 5th Floor jjhaowei reply:

Quote: references to the third floor wlcw16 reply:

The principle and viewpager same.
I am now using viewpager do, but how that get displayed on both sides? Thank you

This time you can display a screen of it. The gallery can display multiple, you put down the middle of the zoom ....

say that this effect is gallery they do it? I would like to use viewpager it

First, and so, look at other people how to say cow, I not familiar with this interface
Reply:
reference to the 8th floor guoyoulei520 reply:
Quote: references to the 7th floor jjhaowei reply:

Quote: references to the 6th floor guoyoulei520 reply:

Quote: references, 5th Floor jjhaowei reply:

Quote: references to the third floor wlcw16 reply:

The principle and viewpager same.
I am now using viewpager do, but how that get displayed on both sides? Thank you

This time you can display a screen of it. The gallery can display multiple, you put down the middle of the zoom ....

say that this effect is gallery they do it? I would like to use viewpager it

First, and so, look at other people how to say cow, I not familiar with this interface
Thank you, ah.
Reply:
Finally found a way. Thank you, brother gave me a hint above.
Look at this to get out. http://www.trinea.cn/android/viewpager% E5% AE% 9E% E7% 8E% B0% E7% 94% BB% E5% BB% 8A% E4% B8% 80% E5% B1% 8F% E5% A4% 9A% E4% B8% AAfragment% E6% 95% 88% E6% 9E% 9C /

apk decompiled code back to the positive development of the code with syntax discrepancy read.


posts by szuzsq edited 2013-09-27 12:09:38
Decompilation tools related to three: apktool1.5.2, dex2jar-0.0.9.15, jd-gui.exe

For example enumerated type:

Source code is:

 
package com.example.test;

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

public class MainActivity extends Activity {
@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.activity_main);
}
}

enum TestEnum {
one, two, three, four, five, six, seven, eight, nine, ten;
}


After compilation, the bin / classes.dex decompile:
dex2jar.bat classes.dex
Get classes_dex2jar.jar, the code uses jd-gui.exe open the jar, see decompile after:
 
package com.example.test;

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

public class MainActivity extends Activity
{
protected void onCreate (Bundle paramBundle)
{
super.onCreate (paramBundle);
setContentView (2130903040);
}
}

enum TestEnum
{
static
{
three = new TestEnum ("three", 2);
four = new TestEnum ("four", 3);
five = new TestEnum ("five", 4);
six = new TestEnum ("six", 5);
seven = new TestEnum ("seven", 6);
eight = new TestEnum ("eight", 7);
nine = new TestEnum ("nine", 8);
ten = new TestEnum ("ten", 9);
TestEnum [] arrayOfTestEnum = new TestEnum [10];
arrayOfTestEnum [0] = one;
arrayOfTestEnum [1] = two;
arrayOfTestEnum [2] = three;
arrayOfTestEnum [3] = four;
arrayOfTestEnum [4] = five;
arrayOfTestEnum [5] = six;
arrayOfTestEnum [6] = seven;
arrayOfTestEnum [7] = eight;
arrayOfTestEnum [8] = nine;
arrayOfTestEnum [9] = ten;
}
}


We pay attention to see the code decompiled back later, with the difference between the source code.
MainActivity class basically no, but TestEnum big difference to this enumeration. Huh ..

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / /
Although very different, but through trial, to know how the original code is a form of ...
However, the following class, you do not really know how it looks like the original code, and find you a look at ...

 
public class BinderProxy {
private IBinder mBinder;
private ServiceConnection mCon = new ServiceConnection () {
public void onServiceConnected (ComponentName paramComponentName, IBinder paramIBinder) {
/ / Problem here, from start to finish, I did not find it access $ 002 to have this function .. ask everyone else ... this is how it is how the original code may look like?????
BinderProxy.access $ 002 (BinderProxy.this, paramIBinder);
}

public void onServiceDisconnected (ComponentName paramComponentName) {
BinderProxy.access $ 002 (BinderProxy.this, null);
}
};
/ / The following omitted some code ............
}


If the above code access $ 002 this function is God horse situation???????
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
The reply was deleted administrator at 2013-09-27 15:46:52

Reply:
No answer it?
Reply:
It is automatically generated by the compiler, class calls for internal or external class method variables.
You can look at this Post .

How JAVA modify bmp image bit depth, there are parameters to control it?


How JAVA modify bmp image bit depth, there are parameters to control it?
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
If it is android, I do not know Bitmap.Config is not what you're looking for.
Reply:
The reply was deleted administrator at 2013-10-08 09:44:41

Reply:
Bitmap.Config can control how many bits as Bitmap.Config.ARGB_4444, Bitmap.Config.ARGB_8888, Bitmap.Config.RGB_565 etc.

android global data sharing



This afternoon encounter problems between screen pass parameters through pointers that can be used to save the global rewrite Application Data

Examples http://www.eoeandroid.com/thread-30257-1-1.html
then post on according to
Made a small example, but always reported ClassCastException, wrong seek expert advice in the following code
android.app.Application
appTest.java
public class appTest extends Activity {
/ ** Called when the activity is first created. * /
@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
. ((App) getApplication ()) setDemo ("sss");
String demo = ((App) getApplication ()) getDemo ();.
}
}

Application files rewritten
App.java

import android.app.Application;

public class App extends Application {

private String demo;

public String getDemo () {
return demo;
}

public void setDemo (String demo) {
this.demo = demo;
}
}

AndroidManifest.xml


package = "com.appTest"
android: versionCode = "1"
android: versionName = "1.0">

"appTest."android: label = "@ string / app_name">







android: icon = "@ drawable / icon"
android: label = "@ string / app_name">


App.java and appTest.java are com.appTest
in the same package
Seek expert advice! ~! ~! ~ Thank you brother first

<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Solve the problem is not configured to AndroidManifest android: name = ". App" into the first application configured in just fine
Reply:
Get it to pick points up :)
Reply:
Do not understand how
Reply:
http://www.eoeandroid.com/thread-30257-1-1.html
Reply:
reference to the third floor qthsrs232 reply:
do not understand how
this can take points