w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Generating a Pro Guard configuration file with Android Studio
You can copy the default Proguard configuration file to your project. sdk-location/tools/proguard/examples/android.pro — copy and paste it as proguard.cfg in your project. Then choose it when AS asks for the config file path.

Categories : Android

R.java is not generating neither with eclipse nor with Android Studio
I'm not sure about Eclipse, but the most recent version of Android Studio (0.1.6) has a known bug like this that only has a workaround at this point. The workaround is to turn off external build in preferences > compiler.

Categories : Java

Android NoClassDefFoundError vs. Error generating final archive: Found duplicate file for APK:
Make sure the JAR is checked as "exported": right-click on the project -> Properties -> Java Build Path -> Order and Export tab -> Make sure the JAR entry (or "Android Private Libraries") is checked. I have a similar setup (with a project containing Libgdx-dependent "common" code that I share among my Libgdx projects). However, instead of building a JAR, I just include the project directly. (Java Build Path -> Projects tab -> Add...). I had to include my CommonProject explicitly in all of the Libgdx project (common, desktop, android, etc), it wasn't "inheriting" from the Libgdx common project into the android one. You may have to do something similar with your JAR file.

Categories : Java

Android Studio: access a listview element in the xml file from the java file.
Assuming you have a layout file mylayout.xml with this <ListView ... android:id="@+id/listView"/> In the onCreate(Bundle savedInstanceState) : public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mylayout); ... ListAdapter myAdapter = new MyListAdapter(...); ListView listView = (ListView)findViewById(R.id.listView); //use the id specified in the layout file listView.setAdapter(myAdapter);

Categories : Android

How to access a js file from another js file in titanium studio android project
You have to use Alloy to do this, to open the Home controller view just do this: function login_Click(e){ var homeController = Alloy.createController('home'); // If home.xml's container is a Window this will work homeController.getView().open(); }

Categories : Android

Android Studio issue with R file
Yes this is a known issue in the newest version of android studio. Google has suggested a temporary workaround until they can track down the problem and fix in next release. Turn off external builds in preferences > compiler. It might help. Source: cannot resolve R into variable after Android studio update and R.java not updated after update to 0.1.6 . Hope this helps.

Categories : Android

Android Studio File Structure
Look at the top toolbar of the Structure tool window, the first two buttons control the sort order. The first button sorts by visibility and the second sorts alphabetically. Ensure that BOTH are unchecked in order to view the structure in the order in which items appear.

Categories : Android

Where is android studio building my .apk file?
When Gradle builds your project, it puts all APKs in build/apk directory. You could also just do a simple recursive find command for *.apk in the top level directory of your project. Here is a better description... View full image at http://i.stack.imgur.com/XwjEZ.png

Categories : Android

how to update android studio with .jar file?
Note: There is not a patch update available from 0.1.9 to 0.2. To update from Android Studio 0.1.x to 0.2.x, you must install a new Android Studio bundle from this page. The reason for that is that we have made changes to the bundled SDK such that it includes a pre-configured local Maven repository which can serve up the v4 support library and which is required for creating new projects. From http://developer.android.com/sdk/installing/studio.html#Revisions So why not downloading a new version of Android Studio? Update: If you can't update by network. Try this: java -classpath /path/to/AI-130.687321-130.692269-patch-unix.jar com.intellij.updater.Runner install $PWD From https://code.google.com/p/android/issues/detail?id=56068

Categories : Android

xml file in android studio appears an error
This sample code can helps you. Take care on android:shape="rectangle" . <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <gradient android:angle="180" android:centerColor="@color/Bisque" android:endColor="@color/Red" android:startColor="@color/Red" /> <stroke android:width="1dip" android:color="@color/Black" /> <corners android:radius="3dip" /> <padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" /> </shape> Try this for your code: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> &

Categories : Android

Android Studio - Unable to open PNG file
Are you using Windows? This error could happen if the generated build file path exceeds the Windows (not NTFS) max path length of 260 characters. Make sure your project path is not too long, use short names as well. More info from MS: Maximum Path Length Limitation In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:some 256-character path string" where "" represents the invisible terminating null character for the current system codepage. (The characters < > are used here

Categories : Android

how can I add the aidl file to Android studio (from the in-app billing example)
Just as the error message says, you need to put IInAppBillingService.aidl in the correct directory dictated by it's package (com.android.vending.billing). Within the src/main/aidl/ folder you already have, put the .aidl file in com/android/vending/billing/.

Categories : Android

Android Studio Issue - Premature end of file
This happened when I checked out the project in another computer and then back to the first one. I fixed the problem by closing the project and then File > Import Project... from the exect same sources. Android Studio fixed the project while keeping all previous gradle configurations. It drove me crazy too :)

Categories : Android

See database file(content) via Android Studio
This might not be the answer you're looking for, but I don't have a better way for downloading DB from phone. What I will suggest is make sure you're using this mini-DDMS. It will be super hidden though if you don't click the very small camoflage box at the very bottom left of program. (tried to hover over it otherwise you might miss it.) Also the drop down that says no filters (top right). It literally has a ton of different ways you can monitor different process/apps by PPID, name, and a lot more. I've always used this to monitor phone, but keep in mind I'm not doing the type of dev work that needs to be 120% positive the database isn't doing something out of the ordinary. Hope it helps

Categories : Android

Automatically generating extensions to partial classes in visual studio
As suggested in the comments, it's quite feasible with T4. With regard to transforming on build, you can do it with a <TransformOnBuild> property in the .csproj file. see this question, in particular @Cheburek's answer. There is more information on MSDN. Then to locate the classes with the AutoExtend attribute you'd need to use EnvDTE instead of reflection, because any existing assembly would be out of date. Something like: <# // get a reference to the project of this t4 template var project = VisualStudioHelper.CurrentProject; // get all class items from the code model var allClasses = VisualStudioHelper.GetAllCodeElementsOfType(project.CodeModel.CodeElements, EnvDTE.vsCMElement.vsCMElementClass, false); // iterate all classes foreach(EnvDTE.CodeClass codeClass in allClass

Categories : C#

How can I set up custom namespaces in layout file in Android studio?
res-auto uses the current package name, not the library package name. In your case, it translates to net.mypackage. If you want to use the namespace for a library, you need to use its package name. Judging from the class name, you are using the DSLV library from here. So, you'll want to use: xmlns:dslv="http://schemas.android.com/apk/res/com.mobeta.android.dslv"

Categories : Android

no gradle file in eclipse project Android studio
All you need is a simple build.gradle file for your ActionBarSherlock project. Here's one I've created: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' } } apply plugin: 'android-library' dependencies { compile 'com.android.support:support-v4:13.0.0' } android { buildToolsVersion "17.0" compileSdkVersion 17 sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } } }

Categories : Eclipse

Android Studio ORMLite Configuration File - Could Not Find Raw Directory
I found a decent solution. Use a separate IDE (not Android Studio) to create your configuration file. In my case I used NetBeans IDE 7.3.1 and it worked just fine. run: Writing configurations to G:MachineSoundsProjectMachineSoundssrcmain es awormlite_config.txt Wrote config for class machinesoundandroidorm.RecordedSound Done. BUILD SUCCESSFUL (total time: 0 seconds)

Categories : Java

Android Studio: How to create build.gradle file for use on Jenkins?
I ended up creating these build files from scratch. Here's some guidelines: If you have a project with multiple modules, create a settings.gradle file at the root of your project (at the same level as all the modules). Your settings.gradle file should look something like this: include 'ActionBarSherlock' include ':facebook-android-sdk-3.0.1:facebook' include 'google-play-services_lib' include ':SlidingMenu-master:library' include 'Tinder' include 'ViewPagerIndicator' include 'volley' include 'windowed-seek-bar' Within each module, create a build.gradle file. For library projects, your build.gradle file should look something like this: buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' } } app

Categories : Android

Android Studio: "could not find method compile<> for arguments [file collection]"
I had the same problem, but I added the dependencies to the wrong build.gradle. You have to add the dependencies to the AndroidStudioProjects/Project/Project/build.gradle, not AndroidStudioProjects/Project/build.gradle.

Categories : Amazon

Android studio file explorer not showing files in data folder
I found a solution based on the answer in stack overflow . How to access data/data folder in Android device? First i rooted the device .Then i modify the access permission of data folder using adb shell. the code is $ adb shell $ su # mount -o rw 1|root@android:/ # chmod -R 777 data/ Now i can access the files.Thank you @param for your valuable comment.

Categories : Android

Unable to render the XML attributes when referencing @dimen resource file in Android Studio
I hope this helps someone. Today I faced the same issue as reported above. I am using windows 8.1, 64bit, jdk 1.8.0, android studio 1.2 Beta 3. What I did was; go to dimens.xml file, (location is: res/values/dimens.xml) and open it up. create any arbitrary change, and save the change. In my case, I added a duplicate value with a different name i.e. 16dp Going back to the layout preview, the error notification simply disappears. You may now go back to dimes.xml and undo the arbitrary changes, to restore the original state of the file if you wish to. I don't have any technical reasons why this fixes it, but sure it worked for me. I guess it is a bug or something.

Categories : Android

Change project file structure after migrating from Eclipse to Android Studio gradle structure
While migrating your project from Eclipse to Android Studio, no change have been done on project structure. The only that have changed are new .iml and .gradle files. Your java code stays in project/src/ folder, and has not been moved in project/src/main/java folder (like in a new created project from AndroidStudio). Your AndroidManifest file also stays in the project/ folder and has not been moved in project/src/main/ folder (like in a new created project from AndroidStudio). At migration, the build.gradle file is customized in order to be able to compile with the old structure is described in the gradle documentation : Configuring the Structure For a new created project in AndroidStudio, the sourceSets part of the build.gradle file : sourceSets { main.java.srcDirs = ['src/java']

Categories : Android

JSP generating .xml file
while I'm disagree with generating xml with jsp but you can add this section inside web-app(tag) in your web.xml <servlet> <servlet-name>JspXML</servlet-name> <jsp-file>/pages/foo.jsp</jsp-file> </servlet> <servlet-mapping> <servlet-name>JspXML</servlet-name> <url-pattern>/foo.xml</url-pattern> </servlet-mapping> while you are still can access the xml file by foo.jsp, for preventing that, just put the jsp file in WEB-INF folder

Categories : Java

Generating SALT for Android Licensing
A non random salt isn't going to be very secure, in theory someone can generate every combo for your app (however thats unlikely). I suggest you take a look RSA public key cryptography. You may want to have a look at How to use public encryption to manage licensing on android applications? . Edit: I was a bit unclear on you question at first, Android: Do the random SALT bytes passed to AESObfuscator need to stay the same? i think is a duplicate that has an answer.

Categories : Android

R.Java not generating on any android project, even if it's new
Okay, I found out the issue. What happened was that while there were no XML errors in MY projects, there were a few in a library I was using. That completely destroyed the R.Java's ability to autogenerate.

Categories : Java

Android .R not generating - checked all common causes
Update your SDK Tools from the SDK manager and ADT in eclipse, this was fixed in the latest update (22.0.1) Also, after you update your SDK, close and reopen the SDK and check for updates again (in case you don't see 22.0.1) Take a look here for some similar issues Class not found error after updating ADT and Android sdk tools to latest ver 22

Categories : Java

Android: How can I open an older android project in Android Studio?
Look at this links. How do I open my existing Eclipse projects in Android Studio? http://developer.android.com/sdk/installing/migrate.html

Categories : Android

Generating doc file from html
Here Is list of supported attribute. Ms word supported html tag Here you can see and use it carefully in your project. It will help to make you minor change. Maximum tag has full support except div tag. Link for check COREEXTENDED div has COREEXTENDED support. You can see it at link.

Categories : Java

Generating a .txt File From a DataTable
i can't say for sure what cause that, but i can see that you (and us) need more information. let's start by knowing how many rows are in the Product.Rows by putting a breakpoint and see in a watch the count property. after that, and if the number of rows is the same you though it was, put a counter on the loop and check that it passes through the loop the same amount of times. finally, try to find the last line written to the file and debug that line in the loop step by step. you might get exception (not likely, but a possibility) and you might find out more on the problem

Categories : C#

Generating the dll file for the solution
A solution is a structure for organizing projects in Visual Studio. solution is just a container for a set of projects. Solution files won't generate DLL's combining all the projects inside. Only project files can generate Dll's, So if you are seeing a MyFramework.dll then there is some other project with the same name.

Categories : Visual Studio

Generating a client certificate on an Android device
You can run the following code on Android to generate a keypair and retrieve the fingerprint. It uses the excellent JSCH library from jCraft. public void generatePublicPrivateKeyPair() throws Exception { ByteArrayOutputStream privateKeyOutputStream = new ByteArrayOutputStream(); ByteArrayOutputStream publicKeyOutputStream = new ByteArrayOutputStream(); JSch jsch=new JSch(); KeyPair kpair=KeyPair.genKeyPair(jsch, KeyPair.RSA); //kpair.setPassphrase(passphrase); kpair.writePrivateKey(privateKeyOutputStream); kpair.writePublicKey(publicKeyOutputStream, "Generated by vPro Management Console"); String fingerPrint = kpair.getFingerPrint(); System.out.println("Finger print: "+ fingerPrint); kpair.dispose();

Categories : Android

Dynamically generating an EditText on touch in android
The EditText if an android widget and placing a android widget inside a canvas probably will not work i.e view's events etc working. As android widget is not a "canvas object". Placing a EditText on Top of a canvas will work but then you don't need the canvas at all. Placing an EditText object to a layout at a obsolete position cannot be done directly. You can only place the object at different positions and then increase the margins do the EditText will distance the anchor position on canvas. The game engine can be recomended for the stuf like this and you can use game engine like andengine.

Categories : Android

Eclipse not generating android button properties
I hope you do everything in such sequence: 1.Create layout at res/layout/your_layout.xml 2.Put button in this layout: <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button text" android:id="@+id/btnSubmit"/> 3.And then in your Activity (onCreate) Button btnSubmit = (Button) findViewById (R.id.btnSubmit);

Categories : Java

PHPExcel is not generating correct xls file
You need to pass a filename to the save() method. Then read the contents of that files and echo to the browser. $writer = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $writer->save("excel.xls"); readfile("excel.xls");

Categories : PHP

generating multiple xml file using xslt
Two solutions are below, though I had to make some assumptions because you are not clear on your requirements. The first solution soap.xsl uses the pull style where elements are manifest in your stylesheet. The second solution soap2.xsl uses the push style where elements are synthesized from the attribute names. I didn't know what more you wanted to do with your stylesheet after these basics were covered. t:ftemp>type soap.xml <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:getDocumentByKeyResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://www.taleo.com/ws/integration/toolkit/2005/07"> <Document xmlns="http://www.tal

Categories : Xml

what is the procedure for generating R.java in android Eclipse juno
Click on Project -> Build Project Edit Remove your gen directory and bin directory Click on Project -> Clean (wait till cleaning complete) Click Project -> Build Project

Categories : Android

Generating eclipse project from android gradle plugin
I feel like my response may be short of a true answer, but hopefully it qualifies under "Any ideas?" Anyhow... It's hard to know without seeing more of the gradle file, but I find the warning gradle is giving you to be quite suspicious. TaskContainer.add() doesn't really jump out at me, but the suggestion does. Please use the cr:eclipseClasspath Now obviously deprecated doesn't automatically mean "this won't work" but gradle is suggesting you use cr:eclipseClasspath and it sounds like you are having issues with the eclipse classpath. It's hard to assume the warning and your issues are not related. Have you done any investigation along that route?

Categories : Android

Generating Ldifs with Help from AWK (can't parse input file)
awk doesn't allow you to split quoted strings over two lines, unless you mark each line as a continuation by putting a at the end. Since you are already including in the output explicitly, you can just fix things up by putting the continuation markers everywhere a quoted string is split: awk -v uid=999905284 ' { print "dn: uid="$0",ou=aaa,ou=bbb,dc=br uid: "$0" sn: "$0" cn: "$0" mail: "$0"@grupos.a.br description: "$0" phpgwAccountType: l phpgwAccountStatus: A uidNumber: "uid++" gidNumber: 0 deliveryMode: forwardOnly accountStatus: active defaultMemberModeration: 1 " }' list

Categories : File

Generating a download link for an uploaded file using PHP
You need to write file download code on that page where your link is pointing. From link extract the file name and write the following code if (file_exists($file)) { if (FALSE!== ($handler = fopen($file, 'r'))) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename($file)); header('Content-Transfer-Encoding: chunked'); //changed to chunked header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); //header('Content-Length: ' . filesize($file)); //Remove //Send the content in chunks while(false !== ($chunk = fread($handler,4096))) { echo $chunk; } } exit; }

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.