Problems encountered in Android development summary "four"

Source: Internet
Author: User
Tags gtk imagemagick

92.
Looks like there is no-avoid modifications made by the import plugin. All the settings it was three checkboxes related to dependency management. I tried to uncheck all of them and still it does change my project structure.

I managed to add existing library projects manually:
1) Copied library ' s directory under the root directory of my project.
2) referenced that the library in Settings.gradle by adding include ': Librarya '.
3) Added dependency to my project ' s Build.gradle:compile project (': Librarya ').

Moreover, after then the IDE recognized that library as module and highlighted it folder in bold font Whithin Project Str Ucture.

93. How do I get the root view from the current activity or how does Android get the activity view?

((ViewGroup) Findviewbyid (Android. r.id.content)). Getchildat (0)
Or
GetWindow (). Getdecorview (). Findviewbyid (Android. R.id.content)

RadioButton in 94.radiogroup How to not display the icon button, and can be proportional to the use of Wight
android:button= "@none" or @null
Android:drawabletop = "@drawable/xxx" or also set to NULL

95. Search is also an art enrichment search detailed search

96.android layoutinfater No display content check if parent is trying to be empty

97
. Error:execution failed for task ': App:dexdebug '.

com.android.ide.common.internal.LoggedErrorException:Failed to Run command:
/home/yyb/tools/android/sdk/build-tools/21.1.2/dx–dex–no-optimize–output/home/yyb/work/boshitong/trunk/hbfc/ Android/hbfc-as/app/build/intermediates/dex/debug–input-list=/home/yyb/work/boshitong/trunk/hbfc/android/ Hbfc-as/app/build/intermediates/tmp/dex/debug/inputlist.txt
Error Code:
2
Output:
Unexpected top-level EXCEPTION:
Com.android.dex.DexException:Multiple dex files define landroid/support/annotation/animres;
At Com.android.dx.merge.DexMerger.readSortableTypes (dexmerger.java:596)
At Com.android.dx.merge.DexMerger.getSortedTypes (dexmerger.java:554)
At Com.android.dx.merge.DexMerger.mergeClassDefs (dexmerger.java:535)
At Com.android.dx.merge.DexMerger.mergeDexes (dexmerger.java:171)
At Com.android.dx.merge.DexMerger.merge (dexmerger.java:189)
At Com.android.dx.command.dexer.Main.mergeLibraryDexBuffers (main.java:454)
At Com.android.dx.command.dexer.Main.runMonoDex (main.java:303)
At Com.android.dx.command.dexer.Main.run (main.java:246)
At Com.android.dx.command.dexer.Main.main (main.java:215)
At Com.android.dx.command.Main.main (main.java:106)

Three forms of 98.android animation tween animition, Frame animition, property animition

99.LoopingViewPager Quickreturn

    1. appcompat-v7:21.0.0 ': No resource found that matches the given name:attr ' android:actionmodesharedrawable '
      Http://stackoverflow.com/questions/26431676/appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro

101.recycleview vs ListView head foot. Recycleview realize the new things in the GridView do not evade, opportunities.

102. Remove unused resources from Android projects http://www.cnblogs.com/angeldevil/p/3725358.html

103.xmlns:tools and Tools:context
tools:context= the phrase "activity name" will not be packaged into the APK. Just the layout editor of ADT sets the corresponding render context in your current layout file, indicating that the rendering context of your current layout is the activity that the activity name corresponds to. If the activity has a theme set in the manifest file, the ADT Layout Editor will render your current layout based on this theme. That is, if you set the mainactivity set a theme.light (others can), then you see in the visual layout manager of the background AH control ah what should be theme.light look. Just to show you what you see and what you get.

    1. Android-studio under volley Android working with volley Library http://www.androidhive.info/2014/05/ android-working-with-volley-library-1/
      http://blog.gssxgss.me/setup-android-studio-and-volley-usage-1/

105.androidstudio Import libs to sync before you can use

Use of 106.fragment + Butterknife
Othersetting–>compiler→annotation processors. Check "Enable annotation processing".

    1. Com.astuetz.pagerslidingtabstrip$pagelistener.onpagescrolled (

108.
02-04 15:55:46.426 5343-5343/COM.JETSUN.HBFC e/inputeventreceiver:exception dispatching input event.
02-04 15:55:46.426 5343-5343/COM.JETSUN.HBFC e/messagequeue-jni:exception in MessageQueue callback: Handlereceivecallback
02-04 15:55:46.506 5343-5343/COM.JETSUN.HBFC e/messagequeue-jni:java.lang.runtimeexception:native typeface cannot be Made
At Android.graphics.Typeface. (typeface.java:175)
At Android.graphics.Typeface.createFromAsset (typeface.java:149)
At com.jetsun.hbfc.activity.fragment.news.newsfragment$1.onpageselected (newsfragment.java:74)

109.
Custom Fonts in Android Http://sudharti.github.io/articles/custom-fonts-android/

Typeface tf = Typeface.createfromasset (Getactivity (). Getassets (), "Fonts/font_name.ttf");
Typeface TF2 = Typeface.createfromasset (Getactivity (). Getassets (), "Fonts/font_name2.ttf");

TextView TV = (TextView) Findviewbyid (R.id.textview);
Tv.settypeface (TF); Set Typeface

EditText et = (EditText) Findviewbyid (R.id.edittext);
Et.settypeface (TF2);

110.PagerSlidingTabStrip He view throws an exception if there is no tabs available to display. It would be great if the view failed gracefully or gave a better error message. Https://github.com/astuetz/PagerSlidingTabStrip/issues/69

  1. Solution for nested ListView in Android development ScrollView http://blog.csdn.net/minimicall/article/details/40983331

    Overriding the Onmeasure method of a ListView
    @Override
    protected void onmeasure (int widthmeasurespec, int heightmeasurespec) {
    int expandspec = Measurespec.makemeasurespec (Integer.max_value >> 2,
    Measurespec.at_most);
    Super.onmeasure (Widthmeasurespec, Expandspec);
    }

    This method has the same problem, that is, the default display of the first item is the ListView, you need to manually scroll the ScrollView to the top.
    SV = (ScrollView) Findviewbyid (R.ID.ACT_SOLUTION_4_SV);
    Sv.smoothscrollto (0, 0);

    int at_most Measure Specification Mode:the child can is as large as it wants up to the specified size.
    int exactly Measure specification mode:the parent has determined a exact size for the child.
    int UNSPECIFIED Measure Specification mode:the parent have not imposed any constraint on the child.

    112.
    Java.lang.NullPointerException
    At Android.webkit.HTML5VideoView.isPlaying (html5videoview.java:122)
    At Android.webkit.html5videoviewproxy$videoplayer.isplaying (html5videoviewproxy.java:269)
    Check that the manifest file corresponds to the activity's configuration
    Android:configchanges= "Orientation|screenlayout"

  2. caused By:java.lang.IllegalStateException:You need to use a theme.appcompat Theme (or descendant) with this activity.

114.http://jgilfelt.github.io/android-actionbarstylegenerator/
This website can be configured with the Action Bar style online, supporting holo, Support V7, Sherlock

115.
Return to fragmentactivity after other interface exceptions fragment show exception (overlap or not display) resolve side ...
Description of the problem see: http://www.eoeandroid.com/thread-496879-1-1.html
Of course, the problem has not been solved, has been very depressed, today took a little time to change n more keywords to find, finally also forgot where to see a method, Dead horse when live horse medical writing on, incredibly good.
The solution is to rewrite the onsaveinstancestate in fragmentactivity and remove the Super.onsaveinstancestate ().
Reason: The guess should be after the two-level interface throws an exception, the application will return to the upper interface when the Fragmentactivity cache state is read from the onsaveinstancestate, so that the fragment all display (display overlap) or not appear. (just guessing)
[Code]php Code: @Override protected void Onsaveinstancestate (Bundle outstate) {}

116. Fixed duplicate menu items and fragment overlap in Android app https://typeblog.net/tech/2014/08/22/fix-duplicate-menu.html

  fragment Replace appears overlapping May 29, 2014 13:19 The general Fragment container is fragment, the method used: Fragmentmanager FM = getactivity (). Getsupportfragmentmanager (); Fragmenttransaction ft = fm.begintransaction (); Ft.replace (R.id.container, fragment); Ft.addtobackstack (null); Ft.commit (); Replace this method in the fragment directly into the layout of the ID is not a problem, but in the external such as activitiy with the fragment overlay problem. There are a lot of people who say to set the background color or picture for each fragment, but I think the extra fee is resources. In fact, as long as the change to such a good, but the principle of this is also who understand it? http://stackoverflow.com/questions/12958555/ Android-replace-fragment-still-displays-some-of-the-replaced-fragmenttransaction.replace ((ViewGroup) (GetView ( ). GetParent ()). GetId (), fragment);  

117.
Get its FM through activity, assign it to the superior fragment by tag, and get the interface data into it.
if (Getactivity (). Getsupportfragmentmanager (). Findfragmentbytag ("Videos") instanceof Quickreturninterface) {
Mcoordinator = (quickreturninterface) getactivity (). Getsupportfragmentmanager (). Findfragmentbytag ("News");
} else {
throw new ClassCastException ("Parent container must implement the Quickreturninterface");
}

118. Memory optimization related Android memory optimization (large rollup) http://blog.csdn.net/a396901990/article/details/38707007

119.PagerSlidingTabStrip changing the title of the adapter and notifydatasetchanged does not work. #13
Call Notifydatasetchanged () on the Pagerslidingtabstrip instead.
Worked for me yesterday with the data loaded from a cursorloader.

120.Ubuntu screen Recording software recordmydesktop

安装:sudo apt-get install gtk-recordmydesktop使用:安装好之后该软件会在影音软件里面,打开就可以。然后可以选择需要录制的窗口,如果不选择的话就默认是用户在屏幕上的所有操作。点击“录制”就开始了,此时该软件隐藏在   上方的任务栏(红色圆圈),可以随时停止录制。得到的视频保存在主目录下,其格式为Ogg。如果需要把它转换为avi格式,可以安装软件mencoder,命令如下:sudo apt-get install mencoder然后用下面的命令转换:mencoder -ovc lavc -oac copy -lavcoptsvcodec=mpeg4 -o outfile.avi infile.ogv ubuntu动态,制作GIF动画Ubuntu 下, 如何录制 gif 格式的屏幕1. 安装 gtk-recordmydesktop 来录制屏幕, 安装 mplayer 將视频分解成单帧图片, 安装 imagemagick 將单帧图片压缩成一张 gif:sudo apt-get install imagemagick mplayer gtk-recordmydesktop2. 命令行下执行, 录制并保存文件为 out.ogv:gtk-recordmydesktop3. 执行如下命令將 out.ogv 分解成单帧图片:mplayer -ao null out.ogv -vo jpeg:outdir=.4. 执行如下命令將单帧图片压缩成 gif 图片:convert *.jpg out.gif5. 执行如下命令將 gif 图片进行压缩:convert out.gif -fuzz 10% -layers Optimize optimized.gifLive Like You‘re Dying And Never Stop Tying

121. A ListView will create a lot of convertview, not all are reused, such as the same screen display must be different convertview.

122. Selection of the performance optimization framework. Volley "Buttferty Greendao", which Google supports as much as possible, does not use reflection technology, such as Greendao using code generation. Rather than annotations "

为什么greenDao使用的是code generation,而不是注解?对于greenDao,代码生成是非常合理的。在Android平台上,基于注解的解决方式是有缺陷的:它们不得不依赖于元数据的解析和反射。特别是反射,会显著降低ORM工具的性能。另一方面,greenDao会为Android生成优化过的代码。这些生成的代码完全避免了反射。这也是greenDao如此快的主要原因。另一个优势是大小。greenDao的核心lib是非常小的(在100K以下,包括单元测试)。这是因为对于一些ORM的内部逻辑都在generator中,而不是在核心库中。greenDao包含了:DaoCore,DaoGenerator和DaoTest。DaoCore是需要你加入到android项目中的,在Apache License 2版本以下是许可的。DaoGenerator是java程序,负责实体的生成,DAO和其它的文件。DaoTest是单元测试用例额,确保了greenDao本身和其稳定性。DaoGenerator 和DaoTest 在GPL V3以下是可用的。这些许可条款可以满足大部分的开发者使用。

123.Lazy Loading
Lazy is not translated into lazy, almost delay, postpone the meaning.
is not to loading at initialization, but to postpone loading until it must be loading.

124.android-stuido could not save application Settings:java.util.zip.zipexception:incorrect header Check

https://code.google.com/p/android/issues/detail?id=56190It looks like there‘s a corrupted cache.To work around this, invoke File > Invalidate Caches.  If you can‘t start Android Studio at all, try going to the cache directory (its location depends on your platform) and delete it, then start Studio.

125.android.gitignore Https://github.com/github/gitignore/blob/master/Android.gitignore
. gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
. Ds_store
/build
# Built Application Files
*.apk
*.ap_

# Files for the Dalvik VM*.dex# Java class files*.class# Generated filesbin/gen/# Gradle files.gradle/build//*/build/# Local configuration file (sdk path, etc)local.properties# Proguard folder generated by Eclipseproguard/# Log Files*.log

126.NDK with Android Studio http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/

"Four" of problems encountered in Android development

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.