2013年9月24日星期二

[Android] Own collection of more than a dozen cocos2d-x game source

Own collection of more than a dozen cocos2d-x source of the game , leaving the desired mailbox, every night sent !
------ Solution ------- -------------------------------------
lchendes@gmail.com Come
------ Solution - -------------------------------------------
944097597 @ qq. com

------ Solution ------------------------------------ --------
330261752@qq.com come too ,
------ Solution ---------------- ----------------------------
1348953242@qq.com good landlord
------ eference ---------------------------------------
upstairs has been sent ! Note that check !
------ eference --------------------------------------- < br> Thank landlord , has been received, thank you ! !
------ eference - --------------------------------------
zhaozihui@gmail.com LZ super- Like
------ eference ---------------------------------------
zhibudefeng@126.com thank
------ eference ------------------------ ---------------
vrschenst@hotmail.com
------ eference ----------------- ----------------------
I have to give a right, thank you , kingrow@163.com
------ eference ---------------------------------------
zhu.jian.qi @ 163. com
thanks
------ eference ----------------------------------- ----
qiezi0011@163.com Thank you ~
------ eference - --------------------------------------
646180893@qq.com 3Q ~ to it
------ eference ---------------------------------------
592116366@qq.com
3Q
------ eference ----------------------------------- ----
958202234@qq.com
------ eference ---------------------------- -----------
308997460@qq.com Thank you ~
------ eference ------------------ ---------------------
150922886@qq.com
very grateful !
------ eference --------------------------------------- < br> sikes000@163.com
Thank landlord
------ eference ---------------------------------- -----
827320247@qq.com
request to send ah
------ eference --------------------------------- ------
972300529@qq.com
Thank landlord
------ eference ---------------------------------- -----
upstairs has been sent, note that check @ @ !
------ eference --------------------------------------- < br> 1600832394@qq.com good landlord , seeking to send ah
------ eference --------------------------- ------------
come on!!
lingaooli@gmail.com
3Q

------ eference ------------------------------------ ---
304605536@qq.com
------ eference - --------------------------------------
51726610@qq.com
Thank you !
------ eference --------------------------------------- < br> lukaysmail@163.com thanks!!
------ eference ----------------------------- ----------
479408690@qq.com Thank you ah ~ ~ · ·
------ eference ------- --------------------------------
this is the route you paste it in the walk ?

Since you want to share , to come up with an open mind , on places like the network disk . Mail sent to stay looking very awkward. Others too tired tired
------ eference ----------------------------------- ----
good code, you can learn about, thank you landlord !
------ eference --------------------------------------- < br> good life of peace wuzebin.love @ 163.com
------ eference ---------------------------- -----------
good life of peace , thank landlord , yuyubo2@126.com
------ eference ----------- ----------------------------
852764978@qq.com
------ eference ---- -----------------------------------
qinglong61@163.com good landlord ah
------ eference ---------------------------------------
wjkjinke00 @ 126.com ask you for sharing
------ eference --------------------------------- ------
785086905@qq.com Thank landlord
------ eference --------------------- ------------------
realjovi@126.com ask you for sharing
------ eference ---------- -----------------------------
good life of peace , thank landlord , kingftp@163.com
- ---- eference ---------------------------------------
19111267 @ qq . com beg you for sharing
------ eference ---------------------------------- -----
lyxing.bj @ gmail.com

thanks
------ eference ----------------------------------- ----
deadpl@qq.com
good life of peace !
------ eference --------------------------------------- < br> find a . . Good landlord
248232729@qq.com
------ eference ------------------------------- --------
revaldon@gmail.com
------ eference ------------------------ ---------------
3Q!!!
------ eference ----------------- ----------------------
Thank you for sharing it
------ eference ----------- ----------------------------
2847793193@qq.com Thank
----- - eference ---------------------------------------
duanyupinghello@163.com Thank you !
------ eference --------------------------------------- < br> 272612179@qq.com Thank
------ eference ----------------------------- ----------
sunzhyu@yahoo.com.cn Thank
------ eference ------------------ ---------------------
516300464@qq.com Thank landlord ~ ~

------ eference ------------------------------------ ---
995003822@qq.com
Thank you friends
------ eference ---------------------------------- -----
seeking shared , 366749058@qq.com

------ eference ------------------------------------ ---
1689755992@qq.com thank landlord
------ eference - --------------------------------------
228824100@qq.com good landlord < br> ------ eference ---------------------------------------
flytianli@163.com, thanks to the generosity of the landlord .
------ eference --------------------------------------- < br> attantao@21cn.com

thanks landlord !
------ eference --------------------------------------- < br> 14747311656@139.com
------ eference --------------------------------- ------
wzjlovecpp@163.com
------ eference -------------------------- -------------
yangjj653253@163.com Thank
------ eference ------------- --------------------------
lintaodd@163.com Come hero !
------ eference --------------------------------------- < br> birds fact the same
------ eference -------------------------------- -------
dbing129@msn.cn thank the
------ eference --------------------- LZ ------------------
android.wzq @ gmail.com Thank you !
------ eference --------------------------------------- < br> 1575627333@qq.com
3q
------ eference ----------------------------------- ----
120131637@qq.com Thank landlord
------ eference ----------------------- ----------------
landlord nice !
------ eference - --------------------------------------
1534207706@qq.com ah , thank you landlord
------ eference - --------------------------------------
good landlord ah. fanfan_0915@163.com
------ eference ----------------------------------- ----
landlord have made ​​it ?
157889202@qq.com
------ eference ------------------------------- --------
source or something, learn something of the fastest . wojia2788@sina.com
------ eference ----------------------------------- ----
ccsusky@163.com Thank landlord
------ eference ----------------------- ----------------
landlord also gave a 275401168@qq.com Thank you, brother to the landlord
------ eference - --------------------------------------
fjyyess@163.com, landlord great guy . . .
------ eference --------------------------------------- < br> duckcyly@163.com thank landlord !
------ eference --------------------------------------- < br> a405929264@qq.com
------ eference --------------------------------- ------
bd6368@yahoo.com.tw Thank landlord !
------ eference --------------------------------------- < br> 353033985@qq.com
landlord to force too ! Thanks in advance ah !
------ eference --------------------------------------- < br> to a landlord . Thanks 136676537@qq.com
------ eference --------------------------------- ------
landlord you handsome 292076598@qq.com shameful reaching a ~ ~
------ eference - --------------------------------------
hanframe@gmail.com
landlord , seeking hair ah
------ eference ------------------------------- --------
Xianxie , and then reach out and do good manners socialist youth ~
afeng520616@126.com
------ eference ------------------------------- --------
646949370@qq.com good landlord ah
------ eference -------------------- -------------------
xujianrj@sina.com Thank
------ eference ----------- ----------------------------
ninefivefly@foxmail.com thank u!
------ eference --------------------------------------- < br> 289274962@qq.com good life of peace
------ eference ------------------------------ ---------
LZ, sent to NasonYehfm@gmail.com, learn cocos2d-x for a while , and would like to see someone develop a game of skill , Xianxie
Nason 6.11
------ eference ---------------------------------------
luodiqingkaiji@126.com
------ eference ---------------------------------------
349998223@qq.com
good landlord
------ eference ---------------------------------- -----
1003798360@qq.com
good landlord ah !
------ eference --------------------------------------- < br> luodiqingkaiji@126.com, thank landlord
------ eference ------------------------------ ---------
592116366@qq.com Thank landlord
------ eference ------------------ ---------------------
408741495@qq.com Thank landlord
------ eference ---- -----------------------------------
crazy0363@126.com
thanks!
------ eference ---------------------------------- -----
756085934@qq.com Thank landlord
------ eference ------------------------ ---------------
crazy0363@126.com
thanks!
------ eference ---------------------------------- -----
good landlord , 876128721@qq.com
------ eference ------------------------ ---------------
101522787@qq.com good landlord
------ eference -------------- -------------------------
haae@163.com
Thank you very much ah !
------ eference --------------------------------------- < br> 2483871464@qq.com

brothers , thank you , and happy weekend !
------ eference --------------------------------------- < br> hellcoming@163.com

Thank lz dedication a ah. . .
------ eference --------------------------------------- < br> 187042242@qq.com thank landlord !

android dual sim dual standby mobile phone to send text messages Select card 1 or card 2 send questions

Pro ! Thank technicians come what this post .
I am now doing a texting program, but now many domestic mobile phone supports dual SIM dual band mode. I put in the settings option to set the default card canceled, changed Always ask. But I still did not send text messages when I ask questions . The default is to send a card .
Question 1: Now I want to send text messages to make when choosing a card or card 2 send it how to do it ? ; want to provide the next idea .
Question 2: how to determine dual card dual standby mobile phone inserted a few cards ?
Question 3: how to determine whether to set the default card ? And get to set the default card is card 1 or card 2 do ?

------ Solution ------------------------------------ --------
domestic mobile phone mostly with the MTK and Spreadtrum program it, they are their own dual card dual standby achieved .
to MTK example , FeatureOption.MTK_GEMINI_SUPPORT used to determine a dual card dual standby or single card single question .
isSimInsert (int simId) incoming different simId can determine whether the corresponding sim card inserted.
getDefaultSIM () to determine the current default is which card , if only one card must be checked by default this .
Meanwhile , MTK still SIM Manager to do this menu inside the phone, text messaging and other module's default SIM card option, you can individually set the corresponding module default SIM card.
If the user inserted two cards , and set up SMS to always ask , your application to send text messages when the phone pops up Select card 1 or card 2 menu.
------ Solution ---------------------------------------- ----
SDK of course finding out , these are changed MTK these vendors


------ Solution ------------------------------------ --------
question 1: Since you cancel the card in a set , card 2 set , then it is where the work before it ? , Election card 1 or card 2 interface just select the operation key is to look at what the representation Card 1 Card 2 parameters pass on the .
Question 2 : The system is there a way to determine the state of the sim card , the card is ready , whether it be written that can read , there may be trouble is due to double card codes are added to the manufacturers themselves , so maybe you want to look for your own job code , see the manufacturer's documentation for it
Question 3: I think it depends on the code you are using , too little information , nothing effective recommendations
------ eference ---------- -----------------------------
not heavy. . Their first top ! ! ! ! ! ! ! ! ! ! ! ! !
------ eference --------------------------------------- < br> do not sink ah. .
------ eference --------------------------------------- < br> thanks for the answer ! that my application will not pop up card 1 or card 2 I do not know what the Intent such values ​​can fall out of the corresponding interface Oh ~
- ----- eference ---------------------------------------
Hello I have android SDK Richard FeatureOption.MTK_GEMINI_SUPPORT inquiry no corresponding data.

------ eference ------------------------------------ ---

Oh, that we is not no way to do it ?

------ eference ------------------------------------ ---
code? Find code
------ eference -------------------------------------- -
ask the landlord finally, how to solve it ?
------ eference --------------------------------------- < br> with demand ! Not sink !
------ eference --------------------------------------- < br> request code , seeking help ,

[Android] Very simple but very troubled by my memory deallocation problem

 This post last edited by the u011940867 on 2013-09-16 03:34:41
I am in the main function readily write such a method :


        C * c2 = [[C alloc]init];
        c2.test1 = @"whatever";
        NSLog(@"%@",c2.test1);
        [c2 release];
        NSLog(@"%lu",(unsigned long)c2.retainCount);
        [c2 release];
        NSLog(@"%@",c2.test1);


print the results :

2013-09-15 15:29:36.936 MemoryTest [1529:707] whatever
2013-09-15 15:29:36.938 MemoryTest [1529:707] delloc C
2013-09-15 15:29:36.939 MemoryTest [1529:707] 1
2013-09-15 15:29:36.939 MemoryTest [1529:707] whatever

why he was not being given ah , c2 is not released yet ? ? ? And dealloc method has been called the , ah, had destroyed ah ? ? ?
everyone from the perspective of the heap and stack explain it to me ? ? ? My understanding is that c2 is also still pointing to the original pointer that fast memory on the heap , the heap memory contents have not changed, but is marked as available, that can always be covered.

C class is so

@implementation C
@synthesize test1;


-(void)dealloc{
   
    NSLog(@"delloc C");
    [test1 release];
     [super dealloc];
}

@end

------ Solution ------------------------------------- -------

  
About the message sent to released object Can you give an example? ? ?  
because your program is very short, so c2 dealloc abandoned after the value of that part of the memory is old , no one to use it.
And when your program are somewhat complex, and multi- threading may occur when c2 memory pointed to just dealloc immediately re- assigned , for example, this time c2 memory pointed to an NSData, this when you go to call methods such stringByAppendingString NSString will complain because NSData without this approach, and you think c2 points to NSString, error type is Unexcepted selector send to instance: 0x1290a1 this .

Basically you use NSLog error does not occur , because all subclasses of NSObject NSLog can be used to output the description information . Even without also output memory address and the class name.

And you said no oc this error : message sent to released object
you are prepared , right ?
------ eference -------------------------------------- -
you think is right, because c2 is a pointer to a memory region recovered re-write data is not being used , so the memory block is still the old value.
------ eference --------------------------------------- < br>

However, if this time is not given, then what will appear when the message sent to released object such a mistake? ? ? ?
------ eference --------------------------------------- < br>

About the message sent to released object Can you give an example? ? ?
------ eference --------------------------------------- < br>
  
About the message sent to released object Can you give an example? ? ?  

refer to this , enable the Enable Zombie Objects: http://blog.csdn.net/lydyangliu/article/details/9035863

If you follow normal use C / C + + logical point of view, this time , the program will throw exception .
Of course, good programming habits , for pointer processing, natural is the judgment of non- empty , exhausted released promptly set nullptr
------ eference ---------- -----------------------------

    
About the message sent to released object Can you give an example? ? ?          
because your program is very short, so c2 dealloc abandoned after the value of that part of the memory is old , no one to use it.   
And when your program are somewhat complex, and multi- threading may occur when c2 memory pointed to just dealloc immediately re- assigned , for example, this time c2 memory pointed to an NSData, this when you go to call methods such stringByAppendingString NSString will complain because NSData without this approach, and you think c2 points to NSString, error type is Unexcepted selector send to instance: 0x1290a1 this .   
  
Basically you use NSLog error does not occur , because all subclasses of NSObject NSLog can be used to output the description information . Even without also output memory address and the class name.   
  
And you said no oc this error : message sent to released object   
you are prepared , right ?  

wrong that mistake , Khan . . . . . Is the message sent to dealloced object, ( hope I did not misspell ) , I asked , this error and Unexcepted selector send to instance where the difference between ? ? ? What will be reported when the first error ? ? ?
------ eference --------------------------------------- < br>
      
About the message sent to released object Can you give an example? ? ?                
because your program is very short, so c2 dealloc abandoned after the value of that part of the memory is old , no one to use it.     
And when your program are somewhat complex, and multi- threading may occur when c2 memory pointed to just dealloc immediately re- assigned , for example, this time c2 memory pointed to an NSData, this when you go to call methods such stringByAppendingString NSString will complain because NSData without this approach, and you think c2 points to NSString, error type is Unexcepted selector send to instance: 0x1290a1 this .     
    
Basically you use NSLog error does not occur , because all subclasses of NSObject NSLog can be used to output the description information . Even without also output memory address and the class name.     
    
And you said no oc this error : message sent to released object     
you are prepared , right ?          
  
wrong that mistake , Khan . . . . . Is the message sent to dealloced object, ( hope I did not misspell ) , I asked , this error and Unexcepted selector send to instance where the difference between ? ? ? What will be reported when the first error ? ? ?  

an object can not be found , one can not find the way
------ eference ----------------------- ----------------
release is only marked void, can be destroyed .
As for when destroyed , depending on the current memory usage and destruction rules .
seemingly discussed inside the post two years ago .
------ eference --------------------------------------- < br> this problem also plagued me !
------ eference --------------------------------------- < br> release is slow compared to some dealloc , release should be first in the queue before destroying the object ( or stack ) , remember, is almost like , finally calling dealloc to destroy . . .

[Android] How to Andrews part of the code written their own tools category

Existing one activity class

public class MainActivity extends Activity {
/ / ... other code omitted
@ Override
public boolean onKeyDown (int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction () == KeyEvent.ACTION_DOWN) {
if ((System.currentTimeMillis () - exitTime)> 2000) / / System.currentTimeMillis () whenever called , certainly greater than 2000
{
Toast toast = Toast.makeText (getApplicationContext (), " Press again to exit ", Toast.LENGTH_SHORT);
toast.setGravity (Gravity.CENTER, 0, 0);
toast.show ();
exitTime = System.currentTimeMillis ();
} else {
finish ();
System.exit (0);
}
return true;
}

return super.onKeyDown (keyCode, event);
}

}
want to write the above code inside onKeyDown own tools category, others are easy to handle, which is the last one super.onKeyDown (keyCode, event) I do not know how to write , I implore heroes help solve ? Thank you


public class MyTool {

Context context;
Long exitTime;


public MyTool (Context context) {

this.context = context

}


public boolean exit (int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getAction () == KeyEvent.ACTION_DOWN) {
if ((System.currentTimeMillis () - exitTime)> 2000)
{
Toast toast = Toast.makeText (context.getApplicationContext (), " Press again to exit ", Toast.LENGTH_SHORT);
toast.setGravity (Gravity.CENTER, 0, 0);
toast.show ();
exitTime = System.currentTimeMillis ();
} else {
context.finish ();
System.exit (0);
}
return true;
}

return super.onKeyDown (keyCode, event) ;/ / here I do not know how to write
}

}
------ Solution ----------------------------------- ---------
super is an object , the Senate changed :
	public boolean exit(Activity superActivity, int keyCode, KeyEvent event) {	
// ...
return superActivity.onKeyDown(keyCode, event);
}

------ eference ------------------------------------- -
positive solution, thank you
------ eference ------------------------------ ---------
just found a problem, how to superActivity instantiated :
MyTool tool = new MyTool (this);
Activity superActivity;
public boolean onKeyDown (int keyCode, KeyEvent event) {
tool.exit (superActivity, keyCode, event)
}




------ eference ------------------------------------ ---
change in thinking , and see what I wrote :
	private int pressed = 0;
@Override
public void onBackPressed() {
if (pressed ++ == 0) {
KDialogHelper.showToast(this, "再按一次退出系统");
new Timer().schedule(new TimerTask() {
@Override
public void run() {
pressed = 0;
}
}, 3000);
}
if (pressed > 1) {
finish();
}
}

android similar qq, the following can select multiple interfaces , how to achieve ? ?

As stated above , android similar qq, the following can select multiple interfaces , how to achieve ? ?
------ Solution ---------------------------------------- ----
with Fragment to achieve. examples
------ Solution ------ --------------------------------------
Yes, with fragment, debris ~ < br>

Help , Android debugger ah how to set a breakpoint

Such as the title , written a program , and then stops unexpectedly , and then I set a breakpoint , press f6 a step back , actually do not know the functions transferred to it. Finally it can not move . Still do not know where the error .
always feel and debugging software on the computer is not the same , I do not know where to start .
Seek expert help me ! Thank
------ Solution --------------------------------------- -----
through F5, 6,7, commissioning, 5 to enter inside the function , six progressive , 7 does not enter the function . To other places , it may be where your program terminates
F7 to see if you can still continue to perform
------ Solution ------------------------ future --------------------
view eclipse print log information to find the cause of the error and position
------ Solution ---- ----------------------------------------
recommend that you use the phone debugger, simulator personal feeling a bit slow , affecting emotional development , debugging of applications is almost essential with java , you can break point , the following will be reported LogCat exception .
------ eference --------------------------------------- < br> Bangding own , no one do ?
------ eference --------------------------------------- < br> ah , thank you ah ! If I want to see the error message that you want to how to do it ?
------ eference --------------------------------------- < br> You can view logcat exception information , thank you upstairs two answers , ashamed !

[Android] Urgent ! Modify the application itself, the font size

How to modify a range of numbers ( eg 5-30 ) to change the font size of the application itself does ? On a wrong note .

have done it ? Or give some tips ! Thank
------ Solution --------------------------------------- -----
by defining the style of the font size , use the xml in each style , you can change the application's font
------ Solution --------- -----------------------------------
import a font into the assets folder inside, call setFront method, you can set the size of the text font color, etc.
------ Solution ---------------------------- ----------------


try this ,
add style in styles.xml


then in the activity 's onCreate first line setTheme (R.style.MyTheme); on it.
Note that setTheme only super.onCreate called before , so if it is already open activity must be restarted to be effective.
However, this must also build a lot of style to achieve multiple font sizes.

------ Solution ------------------------------------ --------
private static final float DefaultButtonFontSize = 20f;
private static final float DefaultTextFontSize = 16f;
public static void loadDefaultFontSize(View view){
if (view instanceof TextView) {
loadFontSize(view,DefaultTextFontSize);
}else if (view instanceof Button) {
loadFontSize(view,DefaultButtonFontSize);
}
}
public static void loadFontSize(View view, float size) {

if (view instanceof TextView) {
((TextView) view).setTextSize(size);
}else if(view instanceof Button) {
((Button) view).setTextSize(size);
}

}

To invoke when loadDefaultFontSize on it
------ Solution ---------------------------- ----------------

above wrong , Button inherited child TextView
so you have to change the next sequential

private static final float DefaultButtonFontSize = 20f;
private static final float DefaultTextFontSize = 16f;
public static void loadDefaultFontSize(View view){
if (view instanceof Button) {
loadFontSize(view,DefaultTextFontSize);
}else if (view instanceof TextView) {
loadFontSize(view,DefaultButtonFontSize);
}
}
public static void loadFontSize(View view, float size) {

if (view instanceof Button) {
((Button) view).setTextSize(size);
}else if(view instanceof TextView) {
((TextView) view).setTextSize(size);
}

}

------ Solution ------------------------------------- -------

method applies to dynamically modify the font size, every time you need to call , if you want to modify the application's font size, proposed to amend the style, or there are kinds of use dimens.xml, give you a reference
http://www.oschina.net/code/explore/android-4.0.1/core/res/res/values-w720dp/dimens.xml
------ eference --- ------------------------------------
is to manually change the font size of the program ?
------ eference --------------------------------------- < br>
is to change the font size of the entire application , rather than a place of textview.
------ eference ---------------- -----------------------

If you want the font size from 1-30 , would not have 30 styles ? I do not know I got it wrong not
------ eference --------------------------------- ------

software is running , you can dynamically modify the software fonts?
------ eference --------------------------------------- < br>
Yes
------ eference -------------------------------- -------

is setFont right ?
can give a simple example to see?
------ eference --------------------------------------- < br>
well, you can try
------ eference ----------------------------- ----------
passing , learning
------ eference ----------------------- ----------------
a theme Tool can modify it
------ eference -------------- -------------------------

Will the entire application can be realized inside the font size?
------ eference --------------------------------------- < br> I want to know , the landlord now have the solution yet ?
------ eference --------------------------------------- < br>
not yet
------ eference - --------------------------------------

not yet     
So, now find no ?

Help Failed to find provider info for com.android.launcher2.settings

In determining whether there is a shortcut when the error : Failed to find provider info for com.android.launcher2.settings


Note: In the normal millet and simulator query shortcuts

This is my part of the code :
if (android.os.Build.VERSION.SDK_INT <8) {
AUTHORITY = "com.android.launcher.settings";
} else {
AUTHORITY = "com.android.launcher2.settings";
}

final Uri CONTENT_URI = Uri.parse ("content :/ /" + AUTHORITY
+ "/ favorites? notify = true");


Cursor c = cr.query (CONTENT_URI, null, null, null, null);
------ Solution ------ --------------------------------------
q: 1063105290 seeking advice


------ eference ------------------------------------ ---
issue is resolved
static String getAuthorityFromPermission (Context context, String permission) {
if (permission == null) return null;
List packs = context.getPackageManager (). getInstalledPackages (PackageManager.GET_PROVIDERS);
if (packs! = null) {
for (PackageInfo pack: packs) {
ProviderInfo [] providers = pack.providers;
if (providers! = null) {
for (ProviderInfo provider: providers) {
if (permission.equals (provider.readPermission)) return provider.authority;
if (permission.equals (provider.writePermission)) return provider.authority;
}
}
}
}
return null;
}
------ eference ----------------------------------- ----
this code how to call ? ?

------ eference ------------------------------------ ---
ask your question is how to solve ? I encountered the same problem with you
you can ask the next ?
------ eference ------------------------------------ ---
/ **
* Create Shortcut
*
*** /
private void createShorcut () {

if (! hasShortCut (this)) {/ / determine whether the shortcut has been created
String ACTION_ADD_SHORTCUT = "com.android.launcher.action.INSTALL_SHORTCUT";
Intent addShortcut = new Intent (ACTION_ADD_SHORTCUT);
Parcelable icon = Intent.ShortcutIconResource.fromContext (this, / / ​​shortcut Pictures
R.drawable.ic_launcher);
addShortcut.putExtra ("duplicate", false); / / do not allow duplicate creation
addShortcut.putExtra (Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);
addShortcut.putExtra (Intent.EXTRA_SHORTCUT_NAME, " Ah Habitat " ) ;/ / shortcut name
addShortcut.putExtra (Intent.EXTRA_SHORTCUT_INTENT, new Intent (
getApplicationContext (), WelcomeActivity.class)) ;/ / run the program the main entrance
sendBroadcast (addShortcut);
}

}
/ *
* determine whether the shortcut has been created
*
** /
public static boolean hasShortCut (Context context) {
String url = "";
System.out.println (getSystemVersion ());
if (getSystemVersion () <8) {/ / determine if the system version is less than 2.2
url = "content :/ / com.android.launcher.settings / favorites? notify = true ";
} else {/ / determine if the system is smaller than version 2.2
url = "content :/ / com.android.launcher2.settings/favorites? notify = true ";
}

ContentResolver resolver = context.getContentResolver ();
Cursor cursor = resolver.query (Uri.parse (url), null, "title =?" ; ,
new String [] {context.getString (R.string.app_name)}, null);

if (cursor! = null && cursor.moveToFirst ()) {
cursor.close ();
return true;
}

return false;
}
private static int getSystemVersion () {/ / Get the system version
return android.os.Build.VERSION.SDK_INT;
}

android ics TV / Tablet hide the navigation bar below

Recently doing set-top box applications , need to hide android 4.0.x below ( navigation bar + status bar ) , in the upper I tried a variety of methods, are listed below:

getWindow().getDecorView().setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE);
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
getWindow().getDecorView().setSystemUiVisibility(4);


I would framework / base / packages / SystemUI following tricks ( this application directly to delete ) , and are done full-screen , but also can not use a lot of things to follow , such as wallpaper , USB, etc. have their own re- write , brother here urge Which expert guidance twelve , anxious , etc. ......
------ Solution ------------------- -------------------------
the activity can be set to full screen , there are two ways
1. in the manifest , set the activity 's theme is no titlebar, full screen and the like .
2. pass code is set , getWindow (). setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
------ eference ----------------------------- ----------
Bangding this should not be difficult
------ eference --------------------- ------------------
above method does not work, last modified source : SystemUI, the problem is solved ...
------ eference ---------------------------------------
Will modify it under SystemUI was able to achieve hidden ah ?
------ eference --------------------------------------- < br>
I ask you is how to modify the source code ?

android do modular , yet able to plug-in technology , which under the sad

Above do C + + to do more, for modular addicted , now I do android modularity. . .

(C + + is the way the main program just to give you an exe dll files and other files, code only to the module's source code,

not to the main program 's source code , and then let the development team to write dll dll module finally finished the inside cover to the original dll is completed )

main secret to me , we can only provide apk, the main program references a bunch of lib,

One of the lib is the interface , open code , the other requirements of R & D team developed the lib

question came , development is completed, I have only a few lib engineering and a main program apk,

how packaged them into a new apk it ?
------ Solution ---------------------------------------- ----
see aapt unpack, pack , you can look at the android provided ant build.xml.
But I do not understand your apk since it has been packaged into apk , indicating a reference for the lib is no problem at all ,
Then why did you go in the lib package ? Do not know !
------ eference --------------------------------------- < br> because the lib is modular , packaged finished first apk is no module function , the function R & D team to complete this step , and then under the original apk and the latest lib packaged into functional latest apk, you say all look too, that do not understand
------ eference --------------------------------- ------
I have achieved this you can go and see apkplug http://115.28.43.27/ welcome valuable suggestions

[Android] QT4.8.1 QTcreator2.5.0 ubuntu12.04. Ui file button can not be displayed on the Chinese

txt Great God seeking guidance , problems such as the title , English normal display , Chinese display a blank , qDebug garbled in Chinese
've tried to add
QTextCodec :: setCodecForTr (QTextCodec :: codecForName ("GBK"));
and
QTextCodec * codec = QTextCodec :: codecForName ("System");
QTextCodec :: setCodecForLocale (codec);
QTextCodec :: setCodecForCStrings (codec);
QTextCodec :: setCodecForTr (codec);
had no effect
Another : ubuntu can be displayed properly txt Chinese
------ Solution --------------------------- -----------------
utf-8 it ?
------ Solution ---------------------------------------- ----
recommended to use UTF-8
------ Solution ---------------------------- ----------------
your system installed Zh_CN.UTF-8 yet ?
------ Solution ---------------------------------------- ----
locale look
------ Solution ------------------------------ --------------


confirm the next few lines of code is not placed in the wrong location , and write in the main function QApplication app; Try the next line .
------ Solution ---------------------------------------- ----
to use GBK, the system is now installed GBK, so you should be able
------ Solution ------------------- -------------------------
If you need to enter the Chinese QT :

Solution:
prerequisite is Ubuntu already installed Chinese support (ibus).
1, install IBus-qt4 Sudo apt-get install ibus-qt4
2, terminal input : gedit ~ /. profile,
in . profile add click Properties.
# IBus settings
export XMODIFIERS = "@ im = IBus"
export GTK_IM_MODULE = IBus
export QT_IM_MODULE = xim
export IBus &
export LC_CTYPE = zh_CN.utf8

Save and source ~ /. profile can.

Find out
------ Solution ---------------------------------- ----------
interface does not display Chinese , you can check whether the default font Qt support Chinese .
but can not display Chinese and qdebug okay .
------ Solution ---------------------------------------- ----
create a GUI project , just put a button in the upper input Chinese , do not set textcodec, run to see results .
------ eference --------------------------------------- < br>
UTF-8 also tried , or the same effect
------ eference ----------------------- ----------------

tried, no
------ eference ------------ ---------------------------

installed

------ eference ------- --------------------------------
found LC_ALL blank after revision
recompile phenomenon unchanged zh_CN.UTF-8 do not understand why some do not and some have quotes
saw
encoding or UTF-8, is not to be changed zh_CN.UTF-8? ? If yes, how to change it ? ?

------ eference ------------------------------------ ---
wooden people know how to solve this problem ah ? ? ? ?
------ eference --------------------------------------- < br>
  
confirm the next few lines of code is not placed in the wrong location , and write in the main function QApplication app; Try the next line .  
location at which , I'm still a CPP file for each constructor are added , will not
------ eference ------------- --------------------------

how you plan to install GBK? I think Qt creator inside GBK encoding in which there is , ah
------ eference ------------------------- --------------


still ah heroes
------ eference ------------------------------- --------

font using WenQuanYi support Chinese , is following in ubuntu no problem when running function
is the Chinese not show
------ eference -------------------------------- -------

xin jian gong cheng ye bu xing, er qie yong le ni de fang fa lian shu ru ; fa dou mei you yong le! keng a!
------ eference --------------------- ------------------

I have tried in your way, but it doesn't work. ; what is the worse, my Chinese input
software can not work neither ......
------ eference --------------------- ------------------
artificial Sticky ......
------ eference --------------- ------------------------
was also mentioned before , use UTF-8 instead of UTF-8 No BOM source code encoding format.
------ eference --------------------------------------- < br> brothers, you do to solve this problem
I encountered the same problem with you
QT program can display Chinese form title
button inside Chinese is garbled have the solution you
------ eference ------------------------ ---------------
after some searching online , found to be caused by the lack of fontconfig , then re- configure:

. / configure-fontconfig


problem again , configure did not pass , suggesting Fontconfig does not pass , then enter / config.tests/x11/fontconfig directory, run make, find missing freetype associated header file, first ensure freetype development libraries have been installed :

sudo apt-get install libfreetype6-dev

installation freetype header files not found in the standard path , then

ln-s / usr/include/freetype2/freetype / / usr / include / freetype


here again make, or mistake, find missing fontconfig development libraries , so

sudo apt-get install libfontconfig1-dev




again make, no mistakes.

then enter the Qt source code directory , run again

. / configure-fontconfig

pass.

make

make install

complete.


[Android] visual studio 2012 deployment errors occur

I installed win 8 Professional Edition , the compiler is visual studio 2012, windows phone sdk 8.0 , and create a project without the simulator , with the real test , compile-time deployment errors occur directly ,
1> to deploy the application to the device failed.
1> Error: Exception from HRESULT: 0x89721800
get one afternoon , reloading several versions will not work, check the Baidu , etc. can not be resolved , I hope someone help , tell me what is out of the question , how to solve , thank you ~ ~ < br> ------ Solution ----------------------------------------- ---
by removing % LOCALAPPDATA% \ Microsoft \ Phone Tools \ CoreCon \ 10.0 to resolve
Please backup before deleting


------ eference ------------------------------------ ---

this thing where , ah, I have seen this time to solve the problem , but could not find , I hope to inform , thank you.
------ eference --------------------------------------- < br> % LOCALAPPDATA% \ Microsoft \ Phone Tools \ CoreCon \ 10.0

stick to the Explorer address bar
------ eference ----------------------------- ----------

I deleted this , but still useless eh , how to do ?
------ eference --------------------------------------- < br>
I deleted this , but still useless eh , how to do ?  
simulator not loaded ? You are not not open virtualization and two address translation .

then reinstall try again next SDK .

never met this problem, you can only try.
------ eference --------------------------------------- < br>
I deleted this , but still useless eh , how to do ?          
simulator not loaded ? You are not not open virtualization and    two address translation .   
  
then reinstall try again next SDK .   
  
never met this problem, you can only try.  
I've reloaded 2 times , or useless , the simulator is not installed , and start it without the option , at least there is someone else Devices' .
------ eference --------------------------------------- < br> your CPU is Which ? estimate does not support two address translation bar ,
------ eference ---------------------- -----------------

CPU is I3 , have not figure out why, thank you so much to answer . .
------ eference --------------------------------------- < br>
like deleting the wrong place , and now OK , thank you ~ ~

[Android] Own collection of more than a dozen cocos2d-x game source

Own collection of more than a dozen cocos2d-x source of the game , leaving the desired mailbox, every night sent !

------ Solution ------- -------------------------------------
learning to landlord , thank you , mxstronger @ 163. com
------ Solution --------------------------------------- -----
good landlord
fxxd3740@sina.com
------ Solution ------------------------------- -------------
really need
53739493@qq.com
------ Solution ------------------------------- -------------
793995295@qq.com
------ eference - --------------------------------------
171048629@qq.com good good at ~
------ eference -------------------------------------- -
klower.xie @ gmail.com
------ eference ----------------------------- ----------
good landlord seeking to 739697044@qq.com
------ eference ------------ ---------------------------
228330140@qq.com landlord hard
------ eference - -------------------------------------
landlord , good life of peace ~ wangkaihao2010@gmail.com
------ eference ----------------------------- ----------
landlord Hunks great guy ~ red_apple999@hotmail.com
------ eference ---------- -----------------------------
landlord nice person , the young girl grateful ! 250071730@qq.com
------ eference ----------------------------------- ----
landlord nice person , the young girl grateful ! 250071730@qq.com
------ eference ----------------------------------- ----
landlord nice person , the young girl grateful ! 250071730@qq.com
------ eference ----------------------------------- ----
really sincere to direct release download url, to the house is a lie mailbox
------ eference --------------- ------------------------
522803931@qq.com urgent
------ eference ------ ---------------------------------
heizhipian@21cn.com
------ eference ---------------------------------------
landlord , good life of peace Yeah, 973797893@qq.com
------ eference ----------------------------------- ----
upstairs have been sent ! Note that check !
------ eference --------------------------------------- < br> Thank you, landlord of the need to learn 291069532@qq.com amount
------ eference ------------------------ ---------------
754484588@qq.com
------ eference ----------------- ----------------------
1610780618@qq.com Thank landlord .
------ eference --------------------------------------- < br> ruomu42@163.com thank the landlord
------ eference ---------------------------- -----------
ming_1990@qq.com are ready to learn , find the source , thank you landlord
------ eference ------------ ---------------------------
ahfyfnzj@163.com Thank landlord .
------ eference --------------------------------------- < br> landlord good life of peace
clorevil@126.com
------ eference ------------------------------- --------
1455645107@qq.com
------ eference - --------------------------------------
yeloz@126.com, thank you
------ eference ---------------------------------------
yeloz@126.com, thank
------ eference --------------------------------- ------
yeloz@126.com, thank
------ eference ------------------------ ---------------
1160020224@qq.com landlord hard
------ eference ----------- ----------------------------
  The reply deleted by an administrator at 2013-05-11 11:39:45

------ eference ------------------------------------ ---
landlord , boundless love xiaanming173@qq.com

------ eference ------------------------------------ ---
landlord good turn deserves another , year after year making a fortune. Hard landlord . Being self-study 692260208@qq.com
------ eference -------------------------------- -------
upstairs note that check
------ eference -------------------------- -------------
thank you for sharing forevermetal@sina.com
------ eference -------------- -------------------------
515393315@qq.com
------ eference ------- --------------------------------
thank landlord , seeking to share : wssxs8888@163.com
- ----- eference ---------------------------------------
2574270341 @ qq.com
Thank landlord
------ eference ---------------------------------- -----
174817150@qq.com
Thank landlord
------ eference - --------------------------------------
Thank landlord 1002657321@qq.com
------ eference --------------------------------------- < br> landlord good man ah 1076441760@qq.com
------ eference --------------------------- ------------
840023274@qq.com, thank landlord .
------ eference --------------------------------------- < br> seeking to share bxcx@163.com
------ eference ----------------------------- ----------
Thank you for sharing .
foxtyg@yeah.net
------ eference ------------------------------- --------
771713759@qq.com Thank
------ eference ------------------ ---------------------
522581157@qq.com
------ eference ----------- ----------------------------
1361986906@qq.com landlord good life of peace ~
------ eference - --------------------------------------
LZ, good people to do in the end , send a I make reference to it , in my mailbox : NasonYehfm@gmail.com
------ eference ----------------------- ----------------
5267621@qq.com
------ eference ---------------- -----------------------
Thank landlord
udbivw19820706@163.com
------ eference ------------------------------- --------
thank landlord 1030581124@qq.com
------ eference ---------------------- -----------------
the landlord I have come a 84556335@qq.com
------ eference ------- --------------------------------
804071259@qq.com
landlord to help ah. . Recently in training, in urgent need ~ ~
------ eference ------------------------------- --------
409349829@qq.com Thank landlord
------ eference --------------------- ------------------
thank landlord 285909218@qq.com
------ eference ---------- -----------------------------
Thank landlord ! lgh1992314@qq.com
------ eference ----------------------------------- ----
changsheng1005@vip.qq.com good landlord peace
------ eference ----------------------- ----------------
xuanfeng1010@qq.com good landlord Thank
------ eference ------------ ---------------------------
thank landlord liushuai@hotmail.com
------ eference --- ------------------------------------
jbf1003@163.com
Thank landlord
------ eference ---------------------------------- -----
979879556@qq.com
------ eference --------------------------- ------------
fightingxs@163.com
------ eference -------------------- -------------------
are learning cocos2d, ask you for sharing
wjkjinke00@126.com
------ eference ------------------------------- --------
kobe1823@163.com
xiang dang kao pu de louzhu
------ eference ------------------------- --------------
alex_my@126.com thank you for sharing .
------ eference --------------------------------------- < br> leiguoqiang518@qq.com thank landlord ah
------ eference ------------------------------ ---------
call the landlord

E-mail : 274291314@qq.com
------ eference --------------------------- ------------
good landlord !
seeking adventure RPG source code !

414867516@qq.com
------ eference ------------------------------- --------
408951390@qq.com
Thank landlord , learn
------ eference ------------------------------- --------
1020470710@qq.com Thank landlord
------ eference --------------------- ------------------
595780836@qq.com
Thank you ~ ~ ~ ~
------ eference ------------------------------ ---------
cyasd5913506@163.com landlord rescue
------ eference - --------------------------------------
krists@163.com Thank you landlord
------ eference ---------------------------------------
dearestmemories@qq.com good life of peace
------ eference - --------------------------------------
564655573@qq.com ; Xiela good landlord
------ eference - --------------------------------------
landlord received no ah !
522581157@qq.com
------ eference ------------------------------- --------
ant1030@qq.com Thank you to share .
------ eference -------------------- -------------------
Thank landlord !
383076654@qq.com
------ eference ------------------------------- --------
35758527@qq.com thank lz!
------ eference --------------------------------------- < br> 89110332@qq.com
------ eference --------------------------------- ------
Thank landlord 611212585@qq.com
------ eference ------------------------ ---------------
renxueaiw@163.com thank landlord
------ eference -------------- -------------------------
thanks very much ~ 247637434@qq.com
------ eference ---------------------------------------
lanjing_1515@163.com, thank you landlord .
------ eference --------------------------------------- < br> 465105145@qq.com Thank landlord
------ eference ------------------------------ ---------
2310021008@qq.com landlord hard
------ eference ------------------- --------------------
39221282@qq.com Thank you for sharing
------ eference -------- -------------------------------
songbiezheng@163.com LZHR
------ eference ---------------------------------------
Thank you for sharing
- ----- eference ---------------------------------------
saying lz not made , then. . .
------ eference --------------------------------------- < br> landlord quickly gave I code it : chfy1203@163.com
------ eference -------------------------- -------------
bacy8500@gmail.com landlord why not put the resources there it ~ ~ You can also earn a small sub
------ eference ---------------------------------------
38845255@qq.com good ah , the landlord , seeking a Thank you !
------ eference --------------------------------------- < br> good landlord , 2496255861@qq.COM
------ eference ------------------------------ ---------
stherry@163.com seeking a thank landlord
------ eference ------------------- --------------------
sunapi@yeah.net are learning in , thanks !
------ eference --------------------------------------- < br> 1349077083@qq.com
------ eference --------------------------------- ------
2581357146@qq.com here first say thank you
------ eference ------------------ ---------------------
253621948@qq.com Thank you , LZ good ^
------ eference ----- ----------------------------------
Thank landlord
jiangawait@163.com

[Android] Getting Started video

seeking Andrews I want to learn Android development , find good people to video or document learning !
305833026@qq.com you know
------ Solution --------------------------- -----------------
you go eoe inside the video tutorial video download mars bar, are based , to start soon !
------ eference --------------------------------------- < br> thanks

android how to program the user can not clear the configuration data for it ?

That is not click on the settings in the " Clear Data " , or what particular way to save the configuration file · · ·
------ Solution ------------ --------------------------------
points to me , I tell you !
------ eference --------------------------------------- < br> general configuration information is stored in the database the way , if the configuration information stored in the file mode , then clear the data when it is not clear the swap . Next time use and then read from the file inside out just fine .

For example , a music player inside , music files stored in a directory which , when set inside the "Clear Data " when only clears the music player inside the database information , and this is the music files will continue to exist the .

specified in the program configuration information is stored to a file , you need time and then read out from this file .
------ eference --------------------------------------- < br> UC Browser has just discovered that when I went to delete the data inside the system settings , I found UC browser will to get rid of this interface , you can selectively delete the configuration file ,
seeking ideas
seeking ideas
seeking ideas seeking ideas
seeking ideas
seeking ideas seeking ideas
------ eference - --------------------------------------
UC and mobile phone manufacturers , built < br> ------ eference ---------------------------------------
That there are other ways it
------ eference - --------------------------------------
CSDN many problems
I did not find a long list of forums to find something in your posts , so obviously the BUG, ​​from the first page to jump directly to the third page
------ eference ------- --------------------------------
they can set the read error in a program which assigns a default value of
------ eference ---------------------------------------


they can set up a program which reads out the wrong assign a default value ?
they can set up a program which reads , error , assign a default value ? · · ·
What does this mean ?
------ eference --------------------------------------- < br> You can store data to sd card
------ eference ------------------------------ ---------

you do not answer , how do I give points it
------ eference --------------- ------------------------

------ eference ------------------------ ---------------
Manifest inside The application which add

android: allowClearUserData = "false"

[Android] How to call the version number and displayed

Rt. . . . . . . . . . . . . . . . . . . . . . . . .
------ Solution ---------------------------------------- ----
Gets the current application version number :
   private String getVersionName() throws Exception
   {
           // 获取packagemanager的实例
           PackageManager packageManager = getPackageManager();
           // getPackageName()是你当前类的包名,0代表是获取版本信息
           PackageInfo packInfo = packageManager.getPackageInfo(getPackageName(),0);
           String version = packInfo.versionName;
           return version;
   }


Gets the version number of the current system :
"Product Model: " + android.os.Build.MODEL + "," 
                + android.os.Build.VERSION.SDK + "," 
                + android.os.Build.VERSION.RELEASE

About the android platform into a grayscale image processing problems

I still do not understand how to use NDK and Android platforms OpenCV ( according http://underthehood.blog.51cto.com/2531780/670169 installed on the installation tutorial , Cygwin can be used , $ NDK/ndk- build command can also be used, but a running program is not open ) , if there are seniors know how to install and use these two , then please guide us be grateful.


because it would not use the front two , and then I need to put a true color converted to grayscale ( single channel ) instead of pseudo- grayscale ( three channels ) , mainly in order to continue to be converted to a binary image subsequent processing. So now I choose this method will become grayscale image .
	    /**
     * 图片去色,返回灰度图片
     * 
     * @param bmpOriginal
     *            传入的图片
     * @return 去色后的图片
     */
    public static Bitmap toGrayscale(Bitmap bmpOriginal) {
        int width, height;
        height = bmpOriginal.getHeight();
        width = bmpOriginal.getWidth();
        Bitmap bmpGrayscale = Bitmap.createBitmap(width, height,
                Bitmap.Config.RGB_565);
        Canvas c = new Canvas(bmpGrayscale);
        Paint paint = new Paint();
        ColorMatrix cm = new ColorMatrix();
        cm.setSaturation(0);
        ColorMatrixColorFilter f = new ColorMatrixColorFilter(cm);
        paint.setColorFilter(f);
        c.drawBitmap(bmpOriginal, 0, 0, paint);
//         c.drawBitm
        return bmpGrayscale;
    }


online Baidu 's Android platform for the grayscale image processing is basically the algorithm, but I looked at the parameters drawBitmap feeling after setSaturation (0) handling seemingly still three channel ah ( do not know the function , seeking to explain , Baidu, can not find a clear explanation ) , and then to ask is this method is converted into grayscale ( single channel ) for you ? ? ? ? ?
brother novice , find you greatly help out .
------ Solution ---------------------------------------- ----
this single figure should be the alpha-8 format picture of it, it can only end Meirenhuida posted .
------ eference --------------------------------------- < br> now know is alpha-8 format is single picture is just black and white drawing , ah, how to deal with what you really need ?

If you get under Android in the Ethernet subnet mask, default gateway, DNS ah ?

As stated , I can get under the Ethernet to IP addresses , does anyone know subnet mask, default gateway, DNS if you get ah ? Note that the Ethernet connection under Oh, no wifi!
------ Solution ----------------------------- ---------------
android linux command execution does not require root privileges visually try
------ Solution ------ --------------------------------------
EthernetDevInfo mEthInfo = mEthManager. getSavedEthConfig ();
Log.i (TAG, "mEthInfo == null:" + (mEthInfo == null));
if (mEthInfo! = null) {
String ipAddress = mEthInfo.getIpAddress ();
String netMask = mEthInfo.getNetMask ();
String dns = mEthInfo.getDnsAddr ();
String gateWay = mEthInfo.getRouteAddr ();
------ Solution ----------------------- ---------------------
not to bicker , looks like you this way public static String getMacAddress () { and not all phones apply. I get their phone test it, and did not find eth0 this node.
My address is / sys/class/net/wlan0/address
------ eference ---------------------- -----------------


amount , linux command , it should be able to see, but to show how the application of the android interface ah ? Seek advice
------ eference -------------------------------------- -

EthernetDevInfo this class import android.net.ethernet.EthernetDevInfo; 'll be prompted to find ah , I did not find the api inside it, really like the others say EthernetDevInfo in the framework layer ? So, how do I use it ? Dumbfounded ,
------ eference ---------------------------------- -----
the way the information has been attached , are collated from others , verified wood in question .
attached below for mac address , Ethernet IP access method, and under the wifi network access and information.
Get Mac Address:
public static String getMacAddress () {
try {
return loadFileAsString ("/ sys/class/net/eth0 / address ")
. toUpperCase (). substring ( 0 , 17 ) ;
} catch (Exception e) {
e.printStackTrace ();
return null;
}
}

obtained under the Ethernet IP:
public static String getLocalIpAddress () {
try {
for (Enumeration en = NetworkInterface
. getNetworkInterfaces (); en.hasMoreElements () ;) {
NetworkInterface intf = en.nextElement ();
for (Enumeration enumIpAddr = intf
. getInetAddresses (); enumIpAddr.hasMoreElements () ;) {
InetAddress inetAddress = enumIpAddr.nextElement ();
if (! inetAddress.isLoopbackAddress ()) {
return inetAddress.getHostAddress (). toString ();
}
}
}
} catch (SocketException ex) {
Log.e ("WifiPreference IpAddress", ex.toString ());
}
return null;
}

wifi network information obtained under relevant :

wm = (WifiManager) getSystemService (Context.WIFI_SERVICE);
d = wm.getDhcpInfo ();

/ / The address code into a string type
public String FormatString (int value) {
String strValue = "";
byte [] ary = intToByteArray (value);
for (int i = ary.length-1; i> = 0; i -) {
strValue + = (ary & ; 0xFF);
if (i> 0) {
strValue + = ".";
}
}
return strValue;
}

public byte [] intToByteArray (int value) {
byte [] b = new byte [4];
for (int i = 0; i <4; i + +) {
int offset = (b.length - ; 1 - i) * 8;
b = (byte) (( value >>> offset) & 0xFF);
}
return b;
}

IP: FormatString (d.ipAddress). toString ();
Default Gateway : FormatString (d.gateway). toString ();
Subnet Mask : FormatString (d.netmask). toString ();
------ eference -------------------- -------------------
mark about learning .
------ eference --------------------------------------- < br>
amount , the amount of my test was produced plate, not on the phone measured , sorry, forgot to illustrate !

[Android] development on windows eclipse + CDT C + + project does not automatically prompt function

development on windows eclipse + CDT C + + project does not automatically prompt function , who knows how to set it
------ Solution - -------------------------------------------
landlord mighty mighty < br> ------ eference ---------------------------------------
own solution , a C + + header files not introduce

[Android] Andrews eclipse java application development , controls are visualized do ( like VB, DELPHI)?

Andrews eclipse java application development , controls are visualized do ( like VB, DELPHI)?
If you manually edit it too much trouble , could you like VB, DELPHI, C + + BUILDER as visual programming it ?
------ Solution ----------- ---------------------------------
with visualization, however, and the kind of level C + + Builder lot worse, is not recommended to use visualization tools , most of their own a little bit of preparation .
------ Solution ---------------------------------------- ----
no CB so smart
------ Solution ----------------------------- ---------------
also like visual interface that , but the function is not so powerful, can be used like .

------ Solution ------------------------------------ --------
have the tools . However, the manual is king ah
------ Solution ---------------------------------- ----------
like visual interface that , but the function is not so powerful
------ Solution ----------------- ---------------------------
are generally not visible, limitations bigger
------ eference ---------------------------------------
can not visualize, develop them very trouble ah
------ eference -------------------------------------- -

Why not visualize it ? ? ? We do not use tools developed in order to reduce the pressure and difficulty do ?
------ eference --------------------------------------- < br> You can use some resources directly from these R classes in your own applications, but you should generally use only resources that you ' ve provided directly in your application, in order to provide a cohesive application package that has no external dependencies. In particular, you should not use drawable resources from the android package, because they may change between platform versions, causing unforeseen conflicts with your design. Typically, styles are the only resources you should use directly from these resources.
android development documents inside these words , it seems that is not recommended to use visual controls . Is that right ?
------ eference --------------------------------------- < br>
Why not visualize it ? ? ? We do not use tools developed in order to reduce the pressure and difficulty do ?
yes ah, upstairs emphasize pure hand -in writing is to show that they are cattle do ? Then you can use Notepad to write ah , why use those integrated environment to compile it !
------ eference --------------------------------------- < br> be right

[Android] EditText of inputType = "true" now shows ... how to display ***

More anxious , seeking expert help ah
------ Solution --------------------------------- -----------
can customize as * , the disadvantage is the input characters are displayed directly as * , rather than show the original characters over one second after the change * .
editText.setTransformationMethod(new AsteriskPasswordTransformationMethod());

class AsteriskPasswordTransformationMethod extends PasswordTransformationMethod {
        @Override
        public CharSequence getTransformation(CharSequence source, View view) {
            return new PasswordCharSequence(source);
        }

        private class PasswordCharSequence implements CharSequence {
            private CharSequence mSource;
            public PasswordCharSequence(CharSequence source) {
                mSource = source; // Store char sequence
            }
            public char charAt(int index) {
                return '*'; // This is the important part
            }
            public int length() {
                return mSource.length(); // Return default
            }
            public CharSequence subSequence(int start, int end) {
                return mSource.subSequence(start, end); // Return default
            }
        }
    }

------ eference ------------------------------------- -
inputType = "textpassword"
------ eference ----------------------------- ----------
this property is set , the display yes. . . . .
------ eference --------------------------------------- < br> tantahe Thank you very much !

[Android] How to download the zip file from the server and unzip to sd card .

There is an address, such as http://ftp.abc.com/dfs/aaa.zip
How do I download from this address above zip file and unzip to sd card inside ? Looks and xml, download pictures are not the same .
request code , be grateful.
------ Solution ---------------------------------------- ----
no code , oh,

looks first in the server decompression,

after decompression is xml, image files

then one xml pictures, download slightly
------ Solution --------------------------- -----------------
java can handle zip with related classes
------ Solution ---------- ----------------------------------
download the zip download with no distinction between ordinary files , downloads down, with java.util.zip. * related operations, or if you find a java -extracting zip google class can be called directly .
------ eference --------------------------------------- < br> I would like to ask you to solve the problem yet ?

android how to implement call recording function

There are two problems :
1. calls later how to trigger the recording function is activated , to use multi-threading it , what is the process code .
2. recording is bidirectional, one's own call recording via mic recording, then the other side of it , it would not be recorded with the mic are they not recorded sound , do not have to open handsfree job ?
------ Solution ---------------------------------------- ----
1, guess need multi-threading
2, that under the agreement it
------ Solution ---------------------------- ----------------


recorder = new MediaRecorder();
// 设置录音为麦克风
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
recorder.setOutputFile(recordAudioFile.getAbsolutePath());
try {
recordAudioFile.createNewFile();
recorder.prepare();
recorder.start(); 
} catch (IOException e) {
e.printStackTrace();
}

------ Solution ------------------ --------------------------
6 F prawn if you only want to record your own voice how do like off the PC machine stereo mix has this function it
------ Solution ---------------------------- ----------------
each other's voices underlying phone module can be captured to
------ eference ----------- ----------------------------
Meirenhuida Mody, answer the first question line ah
- ---- eference ---------------------------------------
you this is not or from the mic recording it , one's own voice is heard, and the other how to do ?

------ eference ------------------------------------ ---
can detail what, the second may be more difficult to resolve , first can you give some examples or code , not necessarily recording is triggered when a call on the line

------ eference ------------------------------------ ---

each other's voices can be recorded down brother,

You can first try what I've tried OK ~
------ eference ----------------- ----------------------
good , prawns , that there is a problem in the first category . . How the recording during a call , when it is triggered . .
otherwise I would not try it . . .
------ eference --------------------------------------- < br> You can use the boot to start a backstage broadcast service to monitor the incoming broadcast time when a call broadcast soon . With phoneMamager.lisen (); to deal with.
------ eference --------------------------------------- < br> I also tried this with a mac to record each other's voices very quietly , would have VOICE_CALL can record audio down the line , but it seems a lot of phones are restricted for security right out of this , if VOICE_CALL will complain , so I been thinking about recording of the problem .. landlord if there any good way , trouble say Ha !
------ eference --------------------------------------- < br> best not to use the mic to record inside , Andrews this point do not, with the palm of the previous system , the recording is very clear.
------ eference --------------------------------------- < br> landlord do you implement two-way audio

------ eference ------------------------------------ ---
huh. Certainly can be achieved. But not yet. . Either way a lot of recordings in order to achieve the different models or else a lot of problems . . .
------ eference --------------------------------------- < br> in the end how to achieve ?
------ eference --------------------------------------- < br>


really it ?

[Android] Nokia phones collected by Microsoft , is it possible to see the future of WP ?

Nokia phones collected by Microsoft , is it possible to see the future of WP ?
------ Solution ---------------------------------------- ----
I saw. .
------ Solution - -------------------------------------------
morning at 11 o'clock messages. . . This do not know, for those of us unable to grasp the market civilians , it can only follow them turn .
------ Solution ---------------------------------------- ----
Microsoft this is a matter of
------ Solution --------------------------- -----------------
old Martin led the past few years , it seems that Microsoft is going backwards. Read the news a little while ago Martin to retire old books , the stock has gone up, investors seem to be saying : This two goods finally gone .

Microsoft led replacement, do not know will not affect the WP8 this business .
------ Solution ---------------------------------------- ----
future is uncertain. .
If Microsoft to go Apple 's line, I will be faced with unemployment .
------ Solution ---------------------------------------- ----
there is hope. . . . . . . . . . .
------ Solution ---------------------------------------- ----

  
Yes, ah, is inherently a closed system   
  
will be more closed it ?  

your so-called closure means for other OEM manufacturers ?
This is really hard to say .
------ Solution ---------------------------------------- ----
unless the new WP system has a " great advantage " , bypassing the Android half the street , it would be difficult to pick up.
domestic machine has to be out of China , to the world , and this time also thinking about doing cell phone , too late.
------ Solution ---------------------------------------- ----
I just want to say , can not put the lights put forward the following three key switch, put forward a gravity sensor switch .................
------ Solution - -------------------------------------------
Microsoft should focus on the development wearable calculated . Phone really has saturated. Has slowly and become a sunset industry .
------ Solution ---------------------------------------- ----
Windows Phone Lumia OS renamed the
------ Solution -------------------- ------------------------
still hope wp market larger. .
------ Solution ---------------------------------------- ----
do not like is the second Motorola , alas
------ Solution ----------------------- ---------------------
may be a bit late now , Andrews is now too popular ah.
------ Solution ---------------------------------------- ----
now WP basic application has , WP8 improved system inside the flaw I think it is more perfect
------ Solution ------------ --------------------------------
calendar harm you now have so
------ Solution --------------------------------------------
Last is the development of Wintel defeated the IBM, this look is not defeated Wintel android development
------ Solution - -------------------------------------------
unless Android system development SB fucks who is , or at least three years to come short of the Andrews ,
------ Solution ------------------------ --------------------
typo , is not open to development
------ Solution - -------------------------------------------
Nokia ah , do not want to do someone else's dog , the end is not cheap prostitute Why not bow to dry Andrews it ? Depressed !
------ Solution ---------------------------------------- ----
Microsoft this is a matter of
------ Solution - -------------------------------------------
okay, Nokia have the background , at least not collapse
------ Solution -------------------------------- ------------
skype also 8000000000 , business is good , the future you, at least Microsoft also afford to lose . Will definitely play it .
------ Solution ---------------------------------------- ----
done Andrews good · · · · · ·
------ Solution ----------------- ---------------------------
Microsoft windows can make a big market share, although everybody denouncing windows how rotten, how insecure , but how many people are not using windows it , according to this , I think if Microsoft seriously engage , will engage in very subversive ! But did not take a good , then, will die miserable !
------ Solution ---------------------------------------- ----
for me personally , I do not like wp system , after all, in the pc using ms system for so long , and now to buy a cell phone , or that a similar interface , I go to Le ;
wp Another important reason is that the system is now available for applications, playability and android and ios is immeasurably , , buy wp phone I feel my heart there is shadow , Had nokia select android instead wp nice
------ Solution -------------------------------- ------------
Nokia turned over ......
------ Solution -------------------- ------------------------
Microsoft unified system and application of various devices , then it is very promising . Wearable do not engage in this kind , suck.
------ Solution ---------------------------------------- ----
outlook is still difficult to say,
look at Microsoft that there is no Apple reborn capabilities.
------ Solution ---------------------------------------- ----
do not like the feel of the application window phone with android and ios far worse. .
------ Solution ---------------------------------------- ----
effect is still there, but closed things, development is relatively slow, I think it can not keep up android.
------ Solution ---------------------------------------- ----
Nokia did not keep up with the trend of Andrews , only into Chunni more quadrangle
------ Solution ----------------- ---------------------------
feeling not as Windows mobile
------ Solution ---- ----------------------------------------
may be a bit late now , Andrews now so popular ah.
------ Solution ---------------------------------------- ----
feeling or compare apples ah , WP system is not easy ah ~ ~
------ Solution --------------- -----------------------------
Microsoft wants to manage Nokia's mobile phone business, and has made great progress , need considerable effort ; functional machine business, large pros , Microsoft sad
------ Solution -------------------- ------------------------
still feel inferior Apple
------ Solution ------- -------------------------------------
ha ha ha ! ! ! ! !
------ Solution ---------------------------------------- ----
people are still those who will be able to change a title to make a good product ? If this is too easy to engage in product


------ Solution ------------------------------------ --------
few days ago to see reports that several major system manufacturers finally have found a piece of hardware, short board , quite agree . Undoubtedly, most people are familiar with the hardware , or the production of hardware , while a software manufacturers do a better understanding of the hardware , there is no doubt that the user is a good news , which means that the software will be better optimization , and this has undoubtedly contributed to the optimization of the entire industry.
wp combination of experience, but I personally feel that Microsoft's acquisition of Nokia 's move to Nokia has a big role , just like Moto X, we are still used to call it is Motorola , not google X. The Google results for a variety of new sales increase friction through the rollers , is indeed not a small bonus. I hope Microsoft can also Nokia's role in the case.
But for wp, I think it's coming in the user experience , look at the current market structure , wp undoubtedly want to expand the road full of hardships . Recalling the IOS listed , by virtue of its comfortable operation experience , as well as refreshing the user interface, so you can quickly dominate the market. The Android is thought to rely on its open source instantly attract the consumer , after all, most people do not want to buy the software and let the phone into a luxury. The slow step wp, compared to the other two systems , the advantage is not obvious, as the ratio of outstanding software IOS, the number of software as well as software direction and Android, which resulted in the wp difficult to quickly enhance market share .
While it is still in the era of mobile phone hardware stack , but do not come out on top in the hardware side , why not look for a better way to end the software does , good user experience, encourage developers to develop applications , improve application quality , should be able to become a good road .
------ Solution ---------------------------------------- ----
computer will have a new feature you can hit a walnut
------ Solution ---------------------- ----------------------
specially came to cherish the memory of it, first of all is the Nokia's S40 system (S60 system machine is too expensive ) , then replaced Microsoft's Smartphone, followed WM6, since - looking google birth systems - watching Microsoft applications dwindling - dazed - expect - disappointment - eventually replaced Andrews - although reluctantly , miss Microsoft smart phone system - because with the habit , although there are now Andrews can play with , but compared to the year WM, always feel bad, but maybe I've seriously behind the times, to feel that this two giants of sorrow. Tribute !
------ Solution ---------------------------------------- ----
close it , close it, anyway, is to spend money to buy it , buy who is not the same , ah, do a little better on the line ,
------ Solution ----- ---------------------------------------


+1
------ Solution ---------------------------------- ----------
u ah right
------ Solution --------------------- -----------------------
Motorola 's footsteps will step right
------ Solution ------- -------------------------------------
 did not see what Microsoft has been the product price is close to the people , hey .... I'm such a poor hanging wire was a bit worried about cash-strapped ....
------ Solution ---------------------------- ----------------
Microsoft and Nokia finally together , combining hardware and software integration , look !!!
------ Solution ---- ----------------------------------------
to Microsoft's operating system market share rate and Nokia hardware , have to say this is an important event. WP
As good now I do not think is very important , it is important for the future direction of development.
------ Solution ---------------------------------------- ----
I bought a Nokia 625
------ eference ---------------------------- -----------
acquisition of Nokia , Microsoft have as much as Apple's mobile hardware manufacturing process.
While Microsoft's mobile platform has been in a follower , but other business has been profitable , Microsoft have the funds still have time to catch up .
------ eference --------------------------------------- < br>

Yes, ah, is inherently a closed system

will be more closed it ?
------ eference --------------------------------------- < br> but do not rename personally feel is secondary, the main direction of its development , as well as whether the change in the support of partners , as well as for application development is to provide greater openness.
------ eference --------------------------------------- < br>

support for other OEM I am more worried .
for 3rd party support should be increased.

I wish him like Google .
------ eference --------------------------------------- < br>
  The reply deleted by an administrator at 2013-09-07 09:02:01

------ eference ------------------------------------ ---
  This reply was moderator deleted at 2013-09-07 07:12:55

------ eference ------------------------------------ ---
  This reply was moderator deleted at 2013-09-07 07:12:21

------ eference ------------------------------------ ---
  This reply was moderator deleted at 2013-09-07 10:47:04

------ eference ------------------------------------ ---
LS send advertising , Banjul it ?
------ eference --------------------------------------- < br>
  This reply was moderator deleted at 2013-09-07 13:56:13

------ eference ------------------------------------ ---


Nokia is dead, because later called MS
------ eference -------------------------- -------------
  This reply was moderator deleted at 2013-09-07 18:26:00

------ eference ------------------------------------ ---
  This reply was moderator deleted at 2013-09-08 00:04:15

------ eference ------------------------------------ ---
  The reply deleted by an administrator at 2013-09-09 08:44:28

------ eference ------------------------------------ ---
  The reply deleted by an administrator at 2013-09-09 12:49:47

------ eference ------------------------------------ ---
  The reply deleted by an administrator at 2013-09-09 12:49:47

------ eference ------------------------------------ ---
  The reply deleted by an administrator at 2013-09-09 12:49:47

------ eference ------------------------------------ ---
  This reply was moderator deleted at 2013-09-09 14:04:43

------ eference ------------------------------------ ---
wait and see , nor things to come , says no .
------ eference --------------------------------------- < br> wp developers make money
------ eference -------------------------------- -------
to Microsoft's powerful, the smart phone market, the strategic layout should be already within the scheme , with the acquisition of Nokia to Microsoft with Apple, Samsung in the smart phone market, the ability to compete , promising
------ eference -------------------------------------- -

windows history just like Apple , Android development history , when there is opportunity, and then apply a large window out , it should be said that window application bundled with the user , rather than the window. In fact, good-looking than the window system interface and not without just pitiful everyday applications , especially those big games. For the army of computer users are mainly young people , the use of other systems too pit . Now iphone, android application abundance , wp Omitted opportunities, and rest on its laurels , without an open mind , it is what attracts the user to go back ? For wp , the best outcome is just one-third of the world , or the weakest party
------ eference ------------------- --------------------
wp potential is still very large , they should have a strong competitive
------ eference - -------------------------------------
Microsoft needs innovation ah
--- --- eference ---------------------------------------
basically late , when the window is to use the free pirated first system into China , and now the wp on and former Apple Computer , as it is difficult to share the
------ eference ---------- -----------------------------
wp8 or good use I liked
---- - eference ---------------------------------------
  The reply deleted by an administrator at 2013-09-10 16:19:10

------ eference ------------------------------------ ---
  The reply deleted by an administrator at 2013-09-10 16:27:04

------ eference ------------------------------------ ---
see it ~ ~ next thing , says no ah ~
------ eference - --------------------------------------
expect WP fire up
------ eference - --------------------------------------
feeling Nokia by Microsoft to pit
------ eference ---------------------------------------
but it is still very much looking forward
------ eference ----------------------------------- ----
expectations. . . . .
------ eference --------------------------------------- < br> specially came to cherish the memory of it, first of all is the Nokia's S40 system (S60 system machine is too expensive ) , then replaced with Microsoft's Smartphone, followed WM6, since - looking google birth systems - Microsoft applications increasingly looking decrease - a loss - expected - disappointing - eventually replaced Andrews - although reluctantly , I miss Microsoft's smart phone system - because with the habit , although there are now Andrews can play with , but compared to year WM, always feel bad, but maybe I've seriously behind the times, to feel that this two giants of sorrow. Tribute !
------ eference --------------------------------------- < br> or to get rid of other systems , either the PC market has also been taken .
------ eference - --------------------------------------

say many are tears
------ eference ------------------------------- --------
not say ah ...
------ eference ----------------------- ----------------
WP and Android will eventually be two feet Dingli
------ eference ------------ ---------------------------
future matter , I really can not say , but Apple is now making made ​​..
------ eference ---------------------------------------
this called the poor to help the poor , are the mobile market vulnerable groups.

Bears will take XIONG Bing , one accurate do nothing to boil .
------ eference --------------------------------------- < br>
  The reply deleted by an administrator at 2013-09-13 08:29:02

------ eference ------------------------------------ ---
not optimistic wp
feel Microsoft still do not understand mobile
feeling Nokia is Microsoft pit
------ eference ------------------------------ ---------

released at the end of WP8 GDR3 will be added to the gravity sensor switch, there is already a tutorial you can turn off the lights the following three key
--- --- eference ---------------------------------------
start a Lumia 820 , objectively speaking, is good , the system is very smooth ( this is beyond the Andrews many ) , the disadvantage is no Android so open , and the application of too few , I think it should be for this reason it
------ eference ---------------------------------------
only waiting to read. Now says still early
------ eference ------------------------------------ ---
not optimistic
------ eference - --------------------------------------
  The reply deleted by an administrator at 2013-09-13 16:15:53

------ eference ------------------------------------ ---
can ah
------ eference --------------- ------------------------
not see, because the motorcycle is an example
------ eference ---- -----------------------------------
  The reply deleted by an administrator at 2013-09-14 09:54:38