w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Adding Permissions in AndroidManifest.xml in Android Studio?
You can only type them manually, but the content assist helps you there, so it is pretty easy. Add this line <uses-permission android:name="android.permission."/> and hit ctrl + space after the dot (or cmd + space on Mac). If you need an explanation for the permission, you can hit ctrl + q.

Categories : Android

Adding Samsung SDK to Android Studio project
Maybe you can follow the instructions in chapter 8 in this document. Click here (invalid link) Be also sure of the .classpath file is not hidden in your project folder, when adding your .jar file. It can typically be the issue.

Categories : Android

Android Studio adding external JAR to the project
the error message format shows that you are not using Gradle to build. You either loaded the eclipse project file (.classpath/.project) or had some existing iml files. This means changes to build.gradle will have no effect since Studio uses the IntelliJ internal builders instead. You need to import your build.gradle file instead to create a new Studio project.

Categories : Gradle

Adding module library to android studio via gradle
Add something like this in your build.gradle repositories { mavenCentral() } dependencies { compile 'com.viewpagerindicator:library:2.4.1' compile 'com.google.android:support-v4:r7' //transitive dependency of viewpagerindicator } From the viewPageIndicator project page : This project depends on the ViewPager class which is available in the Android Support Library or ActionBarSherlock. Details for including one of those libraries is available on their respecitve web sites. That's why I added the support lib in the dependencies (you may need another version)

Categories : Android

Adding support library to android studio project
I fixed it.... All I needed to do was run ./gradlew clean build in the root of my project. Android studio wasn't updating the gradle so it didn't include the external libraries.

Categories : Java

adding a cuda file to an existing c project in visual studio
You have to select the right Compiler for the .cu files Are you following any of the tutorial on how to setup it on visual studio ? http://blog.norture.com/2012/10/gpu-parallel-programming-in-vs2012-with-nvidia-cuda/

Categories : C++

Visual Studio:Adding project file via Power Console is failing
You need to use full path to the project file. Like this: PS> $DTE.Solution.AddFromFile('C:UserssvDocumentsVisual Studio 2010ProjectsConsoleApplication1ConsoleApplication2ConsoleApplication2.csproj')

Categories : Visual Studio 2010

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 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

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

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

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

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

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 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

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

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

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

Adding new JNI file to custom Android SDK
Add my_clas.cpp file to frameworks/base/core/jni/Android.mk LOCAL_SRC_FILES:= mydomain_mypackage_my_clas.cpp This adds your .cpp file to platform. For adding your MyClass.java file to Android SDK update Android API file (where are described all classes, which are included in SDK. Location of that file frameworks/base/api/current.txt): make update-api Then compile your SDK for Linux platform (for example): make PRODUCT-sdk-sdk Your Android SDK with custom class (MyClass.java) will be located at out/host/linux-x86/ in zip archive. Use compiled custom Android SDK in your favorite IDE and easily call MyClass.java

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

Adding audio(wav file) to android Media Store
I've managed to solve it. Grabbed some code from "SD card in Android" new MediaScannerWrapper(ctx, mostRecentRecording.getFullPath(), "audio/*").scan(); ctx.sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + PathsHandler.getInstance().getRecordingsDirectory()))); below is the MediaScannerWrapper which I took it from the post mentioned above: public class MediaScannerWrapper implements MediaScannerConnectionClient { private MediaScannerConnection mConnection; private String mPath; private String mMimeType; public MediaScannerWrapper(Context ctx, String filePath, String mime){ mPath = filePath; mMimeType = mime; mConnection = new MediaScannerConnection(ctx, this); } public void scan(){ mConnecti

Categories : Android

Page still refresh after adding UpdatePanel
You should try adding AsyncPostBackTrigger or the older PostBackTrigger to your UpdatePanel inside Triggers tag like this: <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnUpload_Click" EventName="Click" /> <!-- OR <asp:PostBackTrigger ControlID="btnUpload_Click" /> --> </Triggers> <ContentTemplate> ControlID Gets or sets the name of the control that triggers an asynchronous postback for an UpdatePanel control.

Categories : C#

How do I get Visual Studio 2010 to refresh my DataSet after I have updated the Database source?
Mine turns out to be close to a duplicate question... See this for the answer (and yes, it is as simple as going through the TableAdapter configuration under the DataSet designer.) Update DataSet structure in Visual Studio to match new SQL Database Structure Also, see: http://msdn.microsoft.com/en-us/library/ms171902%28VS.80%29.aspx (How to edit TableAdapters) ... and, as I figured out after nearly losing my mind, I was actually one sub-folder off (meaning there were two copies of the database in my project folder). Projects -> MyProject -> db.accdb, and Projects -> MyProject -> MyProject -> db.accdb. If you're having this issue and querying is NOT working, look VERY closely at the path. VERY CLOSELY. :)

Categories : C#

Adding a file to Android internal storage at design time
What I'd like to do is create the file as part of my Eclipse project, and then have it available to the app at runtime. Is it possible to do this? Yes it's possible, you can create your file in the assets or res/raw directory, then feel its content when the app is running. However, I'm not sure if this is the best place if you have sensitive information to store in.

Categories : Android

adding markers and infowindow without page refresh
Use a createMarker function to hold function closure on the infowindow content. <script type="text/javascript"> var map = null; var infowindow = new google.maps.InfoWindow(); function createMarker(place) { var marker = new google.maps.Marker({ map: map }); // If the place has a geometry, then present it on a map. if (place.geometry.viewport) { map.fitBounds(place.geometry.viewport); } else { map.setCenter(place.geometry.location); map.setZoom(17); // Why 17? Because it looks good. } var address = ''; if (place.address_components) { address = [

Categories : PHP

EntityManger keeps id of removed object and doesn't refresh id after adding new one
I would not recommend reincarnating objects. If you want to persist a new object, then create a new object and persist it, do not use a formerly deleted instance. When you remove an instance, there should be no references to it anymore, including from your app, as the object no longer exists. Also, removing and persisting objects with the same id in the same transaction, is normally not a good idea. If you can, try to use a unique id for each new object. To confirm your error, you remove the same object with the same id twice it the same transaction and persist it once, and the second remove does not work? What does not work, do you get an error, or is no SQL DELETE statement generated? What JPA provider and version are you using? Can you try separate transactions, instead of the s

Categories : Java

Refresh jQuery Mobile elements after adding them to the page using AJAX and PHP
You can call $("#wrap").trigger('create'); in your success callback. Also see this question jQuery Mobile: Markup Enhancement of dynamically added content

Categories : PHP

ZF2 refresh input filter after dynamicly adding elements to form
I also added some elements to the form later what was ignored by the input filter. My solution is most likely not exactly the best one, but as you haven't received any other answers yet, here's what I did: I added use ZendInputFilterFactory as InputFactory; in the class where I'm validating the form data and then used $factory = new InputFactory(); $form->getInputFilter()->add($factory->createInput(array( 'name' => 'title_str', 'required' => true, 'filters' => array( array('name' => 'Int'), ), )));

Categories : Forms

jQueryMobile:refresh after dynamically adding rows to a table with column toggle
I had the same problem. After a bit of hacking through the JQueryMobile code, I've came with this workaround: $("#table > tbody").append(html); $("#table").table("refresh"); // Code to add var columnIndex = 0; $("#table-popup fieldset").find("input").each(function(){ var sel = ":nth-child(" + (columnIndex + 1) + ")"; $(this).jqmData("cells", $("#table").find.("tr").children(sel)); columnIndex++; });

Categories : Javascript

Backbone Bind - Submit a Form while adding to DB and appending ItemView without Page Refresh?
Submitting data to a DB has nothing to do with bind. Bind (and bindAll) are helper methods defined by underscore.js to set what object is referred to by this (see http://underscorejs.org/#bind). To learn more about the "problem" that bind solves, see here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this (paragraph "function context"). With that out of the way, to answer your question: all you need to do is save a new model instance. Backbone will save it on the server with a POST for you (if your urlRoot or url attribute is set up correctly). Then, you add the new model to the collection and Marionette's collection/composite view will add the item view for you automatically (see https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionett

Categories : Backbone Js

How to achieve pull to refresh functionality in android like native facebook android app
Two thoughts: You could use a timer and have your app refresh every few minutes. You could implement something much more complicated that uses something like GCM (Google Cloud Messaging) that would notify the app that there is new data to be refreshed. You would also probably want to only notify the user while they have the app open.

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

Android refresh android.support.v4.app.Fragment from FragmentActivity
you may try in your fragment class: @Override public void setUserVisibleHint(boolean isVisibleToUser) { super.setUserVisibleHint(isVisibleToUser); if (isVisibleToUser) { //do something } } Refresh and Worked for me. :)

Categories : Android



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