Posts

firebase - Android app crash with Android 4.4.4 -

i'm working on android app works on marshmallow , lollipop crashes on kitkat. this project build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.2' classpath 'com.google.gms:google-services:3.0.0' } } allprojects { repositories { jcenter() } } task clean(type: delete) { delete rootproject.builddir } this app build.gradle: apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion '23.0.3' defaultconfig { applicationid "com.moover.moovenda.moover" minsdkversion 16 targetsdkversion 23 versioncode 1 versionname "1.0" multidexenabled true } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules...

java - Complete android cardView with db helper and recycleView -

Image
i pretty new whole android development looking create simple android app making use of sql database, cardviews , recycleview. app have far works trying add button detailedactivity allow me remove entry database. the desired workflow be: get data select cardview click new button (will delete) go cardview, remove entry on button has been pressed , populate cardview. recycleradapter.java package com.example.prabhu.databasedemo; import android.content.context; import android.content.intent; import android.os.bundle; import android.support.v7.widget.recyclerview; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.textview; import android.widget.toast; import java.util.arraylist; import java.util.list; public class recycleradapter extends recyclerview.adapter<recycleradapter.viewholder> { static list<databasemodel> dblist; static context context; recycleradapter(context context...

angular - ReactiveFormsModule vs. FormsModule in Angular2 -

there exists reactiveformmodule , formmodule . import {formsmodule, reactiveformsmodule} "@angular/forms"; when should use reactiveformmodule , provides module comparing formmodule . formsmodule - angular 1 tackles forms via famous ng-model directive. angular 2 provides identical mechanism named ngmodel, allow build called template-driven forms. unlike case of angularjs, ngmodel , other form-related directives not available default. reactiveformsmodule model driven forms. each form has state can updated many different interactions , application developer manage state , prevent getting corrupted. can hard large forms , can introduce category of potential bugs. where can write validations not in html. in case can attach many validations , wrap form. i got here. there better explanation :

opengl - Rendering meshes with multiple indices -

i have vertex data. positions, normals, texture coordinates. loaded .obj file or other format. each piece of vertex data has own index. can render mesh data using opengl/direct3d? in general sense, no. opengl , direct3d allow 1 index per vertex; index fetches each stream of vertex data. therefore, every unique combination of components must have own separate index. so if have cube, each face has own normal, need replicate position , normal data lot. need 24 positions , 24 normals, though cube have 8 unique positions , 6 unique normals. your best bet accept data larger. great many model formats use multiple indices; need fixup vertex data before can render it. many mesh loading tools, such open asset importer, perform fixup you. gl 3.x , d3d10 for d3d10/opengl 3.x-class hardware, possible avoid performing fixup , use multiple indexed attributes directly. however, advised decrease rendering performance. the following discussion use opengl terminology, direct3d v10...

android - Return ArrayList from void AsyncTask -

i googled alot, no chance this. now, have inner asynctask class want use return values in upper class. , work, cause have put log.e() , shows value, here code : public class consume extends asynctask<void, void, void> { private list<latlng> latlngs = new arraylist<>(); private list<contactmodel> contacts = new arraylist<>(); inputstream inputstream = null; string result = ""; @override protected void doinbackground(void... params) { string url = "http://x.x.x.x/mywcf/service1.svc/json/getcontact"; arraylist<namevaluepair> param = new arraylist<namevaluepair>(); try { httpclient httpclient = new defaulthttpclient(); httppost post = new httppost(url); post.setentity(new urlencodedformentity(param)); httpresponse httpresponse = httpclient.execute(post); ...

c# check for a poker straight -

i trying write poker hand evaluation method in c#. have managed every poker hand using linq except straight. don't play straight made of 5 cards increments of 1 each card. ace can high or low. i have created object called card has suit, rank , value (j = 11, q =12 etc..). method passed list of object containing 7 cards (hole cards , board.) another thing bear in mind straight can made if player has 5 or 10. see below methods other poker hands , please let me know if have idea straight method. pseudo code fine also. public bool checkpair(list<card> cards) { //see if 2 cards card same rank. return cards.groupby(card => card.rank).count(group => group.count() == 2) == 1; } public bool checktwopair(list<card> cards) { //see if there 2 lots of 2 cards card same rank. return cards.groupby(card => card.rank).count(group => group.count() >= 2) == 2; } public bool checktrips(list<card> cards) { //see if 3 cards card same ...

java - Android Device Monitor fails with "unexpected error while parsing input: Invalid uiautomator hierarchy file -

Image
i looked through others questions similar issue error log , stack trace different. in case running on osx 10.11.6. android device monitor, version: 25.2.2. when start android device monitor (monitor) @ command line, error dialog displayed: in stack dump, it's looking file /var/folders/5g/8_lp975j6h3d67sc32sqkq3c0000gp/t/uiautomatorviewer_6077102350746730072/dump_7454833342327499247.uix i looked in directory , it's right, file doesn't exist. the gui display, unusable. how can fix this? here full stack dump. $ monitor java.io.filenotfoundexception: /var/folders/5g/8_lp975j6h3d67sc32sqkq3c0000gp/t/uiautomatorviewer_6077102350746730072/dump_7454833342327499247.uix (no such file or directory) @ java.io.fileinputstream.open0(native method) @ java.io.fileinputstream.open(fileinputstream.java:195) @ java.io.fileinputstream.(fileinputstream.java:138) @ java.io.fileinputstream.(fileinputstream.java:93) @ sun.net.www.protoc...